Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
loganathan
Contributor III
Contributor III

Time Interval Creation in Qlik Sense

Hi All,

i am trying to achieve below result from the attached data. but my time interval is not working fine. Can anyone help to achieve this. 'Time Interval' is calculated the time values between 'Time Start' and 'Time Stop'.

 

Time interval# of Items
7-819
8-930
9-1020
10-1117

 

 

Thanks in advance,

Labels (1)
3 Replies
Vegar
MVP
MVP

if your interval is not created  correctly,  then it could be an issue with the interpretation of your time fields. Try this:

interval(time#([Time Stop],'hh:mm')-time#([Time Start],'hh:mm'))

 

loganathan
Contributor III
Contributor III
Author

Hi Vegar,

thanks for your reply. I am using the below format

INTERVAL((Time#(Time([Time  Stop], 'hh:mm'),'hh:mm')- Time#(Time("Time  Start", 'hh:mm'),'hh:mm')) ,'mm') AS Interval,

still all the time interval is not properly calculating. Please advise

Vegar
MVP
MVP

I think you have swapped the intepret time#() with the formating time() function. Try this:

INTERVAL( (Time(Time#([Time  Stop], 'hh:mm'),'hh:mm')- Time(Time#("Time  Start", 'hh:mm'),'hh:mm')) ,'mm') AS Interval,

OR just remove the Time() formating function, since you are going to reformat it to an interval.

INTERVAL( (Time#([Time  Stop], 'hh:mm')- Time#("Time  Start", 'hh:mm')) ,'mm') AS Interval,

If you still have issues with the calculation then please provide an sample/example in order for us to help you further.