Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

Hi,

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

Regards,

Jagan.