Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator II
Creator II

generating the flag is not working

Hi there,

please assist with the below script :

The variable flag is not calculation. Its always going to 0 that is else part.

Table:

LOAD

Interval([Departure DateTime] - [Arrival DateTime], 'hh')as [ED_LOS_HOURS],
if(Interval([Departure DateTime] - [Arrival DateTime], 'hh')>='06',1,0)as [ED LOS > 6 (Hours) Flag]

FROM

[$(vL.QVDPath)\QVD \Table.qvd]
(qvd)

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

The interval() stuff isn't really necessary because you could query the result directly, like:

if([Departure DateTime] - [Arrival DateTime] >= 0.25, 1, 0) as [ED LOS > 6 (Hours) Flag]

- Marcus

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

try below

if(Interval([Departure DateTime] - [Arrival DateTime], 'hh')>= INTERVAL(6,'hh'),1,0)as [ED LOS > 6 (Hours) Flag]

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
marcus_sommer

The interval() stuff isn't really necessary because you could query the result directly, like:

if([Departure DateTime] - [Arrival DateTime] >= 0.25, 1, 0) as [ED LOS > 6 (Hours) Flag]

- Marcus