Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with if statement and time comparison

Hello Everyone,

as usually i need your help

I've this if statement and i need it to create this dimension in a pivot or a listbox:

if(date(ACTION.TIME, 'hh:mm')<=date('14:30','hh:mm'),'Current Day','Following Days')

the date function recognize the hour and minutes and also the 14:30 for the right part but seems that qlik is not able to confront that.


Any suggestions?


Kind Regards,

Alfonso

11 Replies
datanibbler
Champion
Champion

Hi Alfonso,

try using the TIME function for that. I have that in several apps because we work in two shifts, with a changeover at 14:00 - it works for me in all cases. But there should  be no need to wrap that '14:30' in any function as it's just a fixed value - your other function (around the ACTION.TIME) should return a value you can compare to that.

Try with the TIME function for a start.

HTH

PrashantSangle

Hi,

Try to convert it into number then compare.

or try below

if(time(ACTION.TIME, 'hh:mm')<=time(time#('14:30','hh:mm'),'hh:mm'),'Current Day','Following Days')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Gysbert_Wassenaar

date('14:30','hh:mm') won't work. The date() function only formats a date. It doesn't create a date from a string value. Try time#('14:30', 'hh:mm').


talk is cheap, supply exceeds demand
Frank_Hartmann
Master II
Master II

try this:

=if(date(time(ACTION.TIME, 'hh:mm'))<=date(time(('14:30'),'hh:mm')),'Current Day','Following Days')

Not applicable
Author

Don't works too... can you try it before on similar data?

Not applicable
Author

Don't works too... can you try it before on similar data?

Not applicable
Author

Don't works too... can you try it before on similar data?

Not applicable
Author

Don't works too... can you try it before on similar data?

anbu1984
Master III
Master III

Can you post sample app