Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
JonnyZ
Contributor
Contributor

timestamp compare problem

Hi,

If I want to compare the time see if the time is between 17:00:00 to 08:00:00 (night shift),

this statement works,

= if('12:00:00'>'17:00:00', 'Yes', 'No')

But this one seems not,

=if (timestamp(now(),'hh:mm:ss')>'17:00:00', 'Yes', 'No')

where is the problem?

thanks.

Labels (1)
1 Reply
brunobertels
Master
Master

Hi 

Timestamp is a date AND a time , even if you reduce the format to 'hh:mm:ss' it is still 01/07/2022 hh:mm:ss that you try to compare only with a time.

see below timestamp (now()) give 

brunobertels_1-1656681113685.png

 

 

Then try this 

if (time#(now(),'hh:mm:ss')>'17:00:00', 'Yes', 'No')

brunobertels_0-1656680954272.png