Hi All, I'm facing issue while converting unix timestamp to date field. here im using dformat for conversion and im getting only null values, but if i use specific timestamp like this -1652246442000 instead of "AnnivesaryDate" its showing me the correct result
the condition:
results
end result should be in this format 2022-02-10 so,can anyone help with these issue?
sample data which i used:
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
yeah correct while ingestion its taking the field(annivesaryDate) as string
That’s the reason while performing dformat function in calculated field its showing null value and i have corrected the value(data in csv to 9digits(seconds) from 13digits(milliseconds) format) and while performing dformat function I have multiplied 1000 to field(annivesaryDate) so it will be in milliseconds format(dformat only accepts milliseconds) and now i can see the data in date format.
Thank you all for your inputs
You are getting this error because you are trying this with a string(aniversaryData), but it is a field.
Try wrapping the field name in ${} to make it a legal identifier.
example: dformat(${aniversaryData},"yyyy-mm-dd")
Thanks for the reply @Ankit_Chaudhary
I tried with your input also still showing null values, any other pointer on this will be helpful.
Looks like timestamp values in you aniversaryDate filed is in seconds format, currently dformat function support timestamp in milliseconds(I guess). You need to convert your data into milliseconds by adding 3 extra 0 at the end and make it a 13 digit timestamp number.
Views
Replies
Total Likes
yes its already in milliseconds and i was performing batch ingestion
my data is
if i explicitly mention the timestamp its showing the result correctly in calculated field
but if i use the field(annivesaryDate)its showing null
Views
Replies
Total Likes
Would like to understand, if you just reference the field(annivesaryDate), without dformat function, what is it returning at the moment?
Because, if it is stored as string, the additional characters, might be causing an issue. If that is the case you observe, you should have an additional to_int()/to_bigint() to convert the string to numeric value, since the dformat accepts bigint as the parameter.
Hope this helps!
Views
Replies
Total Likes
yeah correct while ingestion its taking the field(annivesaryDate) as string
That’s the reason while performing dformat function in calculated field its showing null value and i have corrected the value(data in csv to 9digits(seconds) from 13digits(milliseconds) format) and while performing dformat function I have multiplied 1000 to field(annivesaryDate) so it will be in milliseconds format(dformat only accepts milliseconds) and now i can see the data in date format.
Thank you all for your inputs
Views
Likes
Replies