Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

DateDiff

     Hi,

How can I change the following sql link in Qlikview:

Case WHEN DATEDIFF(MINUTE,[Arrival DateTime],[Departure DateTime]) > 240 THEN 1 ELSE 0 END [BREACH]

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

If((([Departure DateTime] - [Arrival DateTime]) * (24*60)) > 240, 1, 0)

View solution in original post

5 Replies
sunny_talwar

May be this:

If((([Departure DateTime] - [Arrival DateTime]) * (24*60)) > 240, 1, 0)

MarcoWedel

Hi,

one solution could be also:

-([Departure DateTime]-[Arrival DateTime]>'04:00') as BREACH

QlikCommunity_Thread_191642_Pic1.JPG

LOAD *,

     -([Departure DateTime]-[Arrival DateTime]>'04:00') as BREACH;

LOAD *,

     Timestamp([Arrival DateTime]+Rand()) as [Departure DateTime];

LOAD Timestamp(Today()+Rand()) as [Arrival DateTime]

AutoGenerate 30;

hope this helps

regards

Marco

jagan
Partner - Champion III
Partner - Champion III

Hi,

YOu can try Interval() in Qlikview which is equivalent to DateDiff()

Example: If(Num(Interval([Departure DateTime] - [Arrival DateTime], 'm')) > 240, 1, 0) AS BREACH

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Thank you

jagan
Partner - Champion III
Partner - Champion III

Hi,

If you got the answer please close this thread by giving Correct and Helpful answers to the posts which helps you.

Regards,

Jagan.