Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
prees959
Creator II
Creator II

Within 24 Hours Flag

HI,

Im trying to set a flag to filter the document to Within 24 hours.

My expression is : if(hours_lead_time>=0 and  hours_lead_time<=24,1,0)

However when I filter on this flag within the document it shows hours above 24 hours.

The expression to create hours_lead_time is  interval(start_datetime-requested_on,'h')


Can anyone advise on this please?

Thanks,

Phil

1 Solution

Accepted Solutions
tresesco
MVP
MVP

If you see hour is 1, it is actually 1/24 at the back end. Hence try like:

if(hours_lead_time>=0 and  hours_lead_time<=1,1,0)

View solution in original post

2 Replies
tresesco
MVP
MVP

If you see hour is 1, it is actually 1/24 at the back end. Hence try like:

if(hours_lead_time>=0 and  hours_lead_time<=1,1,0)

prees959
Creator II
Creator II
Author

HI This has worked - but I cant understand why... Can you explain ?

Many thanks,

Phil