Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional If Statement

Hi,

I have two time variables "Call Start" and "Time Created," I am looking to create an if statement that occurs only when the two variables are within 30 minutes of one another (i.e. if the Time Created occurs 30 minutes or less after the Call Start(ed))

Thanks!

3 Replies
oknotsen
Master III
Master III

Something like...:

If([Time Created] - [Call Start] > 1/48, 'Yes', 'No')

Assuming both fields are time stamps.

May you live in interesting times!
Not applicable
Author

How do you get the fraction 1/48 from the time stamps?

Thanks!

Emma

oknotsen
Master III
Master III

Dates (including time) are stored as numbers. A date is the whole number (the part before the decimal point), the time are the fractions of the number (the part behind the decimal point).

So if you wanted to check if the difference is more then 1 day, you would have made it > 1.

But you want to check if the difference is more then 30 minutes. To get to minutes, you divide 1 by 1440 (the number of minutes in a day). You want 30 minutes, so 30 * 1/1440 = 1/48. 48 is the number of half hours in a day.

I hope that clears things up for you .

May you live in interesting times!