Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
In qlik sense, when using the num function, the timestamp is converted to a decimal point.
Even though I converted the timestamp format to date
example : Num(Date(now(),'YYYY-MM-DD'));
return is "44475.719050926"
Not use Today(), only now() function that timestamp data type.
I want to convert timestamp to integer.
i want like below value.
"44475"
how to convert timestamp to integer?
Is there a simple way?
Hi,
You can use floor() function.
E.g Floor(Num(Now()))
Thanks,
Ashutosh
Hi,
You can use floor() function.
E.g Floor(Num(Now()))
Thanks,
Ashutosh
Hi Ashutosh.
floor function is very good way.
Let me ask you one more thing.
Why do I change to date format, but there is a decimal point?
Hi,
You mean, How do you change to date format ?
Apply Date() on top of it to get Date from the integer
Date(Floor(Num(Now())))
Hi, Ashutosh
I used the Num() function to convert, but the result is different.
Date(now(),'YYYY-MM-DD') , Date(Today(),'YYYY-MM-DD') is same result.
This result is "2021-10-07"
But, I use Num() function on the result, the return value is different.
Num(Date(now(),'YYYY-MM-DD')) is "44476.471875"
Num(Date(Today(),'YYYY-MM-DD')) is "44476"
I just curious about the result.
Now() returns the date with timestamp and Today() returns the date only. Hence the difference in an integer with decimal for now()