Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Zara
Contributor III
Contributor III

If statement/flag on a time field

Hey guys, i have a date time field formated dd/mm/yyyy hh:mm:ss.

I'm trying to create a flag in the data load for inbetween our working hours, which is 09:00:00 to 17:30:00.

I feel i must be missing something really simple but i cannot for the life of me get it to work....  

Below is what i have tired...

If(Time("Call Start Time (CommsCall)")>'09:00:00'
and Time("Call Start Time (CommsCall)")<='17:30:00',1,0) as [Outside Working Hours], //Doesnt work

If(Time("Call Start Time (CommsCall)">'09:00:00'
and Time("Call Start Time (CommsCall)"<='17:30:00')),1,0) as [Outside Working Hours1], //Doesnt work

if(time("Call Start Time (CommsCall)")>'09,00,00',1,0) as [Greater Than 9], //Works

if(time("Call Start Time (CommsCall)")>='17,30,00',1,0) as [17:30 And Above],//Doesnt work, the flag starts at 17:00:00

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

The issue might be that Time() as a formatting function doesn't change the numerical part of a timestamp.

So one solution could be to extract the (fractional) time part from your timestamp using the frac() function:

 

If(Frac([Call Start Time (CommsCall)])>='09:00:00' and Frac([Call Start Time (CommsCall)])<='17:30:00',0,1) as [Outside Working Hours]

 

 

 

 

 

View solution in original post

1 Reply
MarcoWedel

The issue might be that Time() as a formatting function doesn't change the numerical part of a timestamp.

So one solution could be to extract the (fractional) time part from your timestamp using the frac() function:

 

If(Frac([Call Start Time (CommsCall)])>='09:00:00' and Frac([Call Start Time (CommsCall)])<='17:30:00',0,1) as [Outside Working Hours]