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: 
smusayev
Contributor II
Contributor II

IF THEN DATE <

Hello,

I need help with the if then else question and using with time.

I need to create a new column in the load editor that looks whether  confirmation was done and if it was done within 4 hours (or 240 minutes) then create a column.


Example:

Column:                Confirm Status (string)            ElapsedTime (date)                        ConfirmWithin4hour

Row:                     Confirmed                   200 ( in minutes)                                         Yes

                            Confirmed                   10000 (in minutes)                                       No

My code is as follows 

Load *

  IF     ("Confirm Status" = 'Confirmed' AND "ElapsedTime" < 280 )   , 'Yes', 'No') AS ConfirmWithin4hour

The code loads however when I check against elapsed time in the app, it does show the correct numbers, as it grays out even numbers below 240 and show number above 240 as well.

I believe I am not using the < sign correctly when it comes to the date.

Please help, or if you have other work around please let me know.  Thank you

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

How about this:

If("Confirm Status" = 'Confirmed' and "ElapsedTime" < Interval#(280, 'mm'), 'Yes', 'No') as ConfirmWithin4hour

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

How about this:

If("Confirm Status" = 'Confirmed' and "ElapsedTime" < Interval#(280, 'mm'), 'Yes', 'No') as ConfirmWithin4hour

smusayev
Contributor II
Contributor II
Author

Thank you so much.