Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
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.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this:
If((([Departure DateTime] - [Arrival DateTime]) * (24*60)) > 240, 1, 0)
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this:
If((([Departure DateTime] - [Arrival DateTime]) * (24*60)) > 240, 1, 0)
 
					
				
		
 MarcoWedel
		
			MarcoWedel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
one solution could be also:
-([Departure DateTime]-[Arrival DateTime]>'04:00') as BREACH
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
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
Thank you
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
If you got the answer please close this thread by giving Correct and Helpful answers to the posts which helps you.
Regards,
Jagan.
