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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare timestamp time with string

Hi,

I want to do something like this:

=if(Time([Order Lowest Object Date/Time],'hhmm')<1400,'Smaller','Bigger')

Whatever the [Order Lowest Object Date/Time] is, it does not get the result I want.

i.e. (01/12/2009) 1300 < 1400

It always says 'Bigger' (unless I replace 1400 by 0)

Any ideas?

Kind regards,

Maarten

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

try

=if(hour([Order Lowest Object Date/Time])<14,'Smaller','Bigger')

View solution in original post

3 Replies
gandalfgray
Specialist II
Specialist II

try

=if(hour([Order Lowest Object Date/Time])<14,'Smaller','Bigger')

erichshiino
Partner - Master
Partner - Master

Hi, Maarten

The time function will only format your number. The actual number behind it is basically the same.

The if syntax will use the full number behind it, despite number format.

In your case, I would tranform the [Order Lowest Object Date/Time] to a number to compare it with 1400.

It would be something like this?

if( hour([Order Lowest Object Date/Time])*100+minute([Order Lowest Object Date/Time])<1400, 'Smaller','Bigger')


Regards,

Erich

Not applicable
Author

Thanks guys!

Exellent soltions! Work perfectly!