Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikers,
I'm comparing the time I obtained from a Timestamp field to time string I converted to time format. Although in time format both values are equal, when I convert them to number, they differ. Let me show you:
So when I try to make comparisons like:
If(Frac(Timestamp('06/09/2022 06:59:59')) <= Num(Time('06:59:59')), ... the result is false. If instead of comparing figures, I compare strings of course it works:
If(Text(Time(frac(Timestamp('06/09/2022 06:59:59')) ,'hh:mm:ss'))<= '06:59:59', ...
A different approach is to obtain the second time from a timestamp field. Then it works depending the year:
If(Frac(Timestamp('06/09/2022 06:59:59')) <=Frac(Timestamp('01/01/2000 06:59:59')), ...
I saw that for dates smaller than '01/01/1990' I'm obtaining different values.
I know that I can use what it works for me but what do you recommend me? I would prefer to continue using numbers for comparing instead of text or avoiding my last example.
Any suggestion???
Thanks for sharing 😉
Hi, as this 'ending' of num format is basically not changing much, maybe round() (or even floor()) function could help to 'equalize' these times, like
round(your_time, 0.00000000001)
Hi, as this 'ending' of num format is basically not changing much, maybe round() (or even floor()) function could help to 'equalize' these times, like
round(your_time, 0.00000000001)