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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
dana
Creator III
Creator III

Formatting Class with Time Interval

Hi People,

I want to display buckets of durations in a histogram, with an interval of 15 minutes:

=Class(Incident_FirstUpdate_Hours, Interval('00:15','hh:mm'))

But the result is in decimal

Class - Time intervals.png

I tried to convert it to interval, but it didn't display it as a bucket:

=Interval(Class(Incident_FirstUpdate_Hours, Interval('00:15','hh:mm')),'hh:mm')

Class - Interval format.png

How do I convert it to Interval?

Thanks!

 

 

Labels (1)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi, you can try to replace/convert num parts to time, f.e. you have your class expression to separate your Incident_FirstUpdate_Hours between 15 min buckets:

class(Incident_FirstUpdate_Hours, 1/24/4)

and from this class 'string' you can create new one with minutes with something like this:

time(subfield(class(Incident_FirstUpdate_Hours, 1/24/4),'<=',1),'hh:mm') & ' <= x < '& time(subfield(class(Incident_FirstUpdate_Hours, 1/24/4),'<',3),'hh:mm')

View solution in original post

2 Replies
justISO
Specialist
Specialist

Hi, you can try to replace/convert num parts to time, f.e. you have your class expression to separate your Incident_FirstUpdate_Hours between 15 min buckets:

class(Incident_FirstUpdate_Hours, 1/24/4)

and from this class 'string' you can create new one with minutes with something like this:

time(subfield(class(Incident_FirstUpdate_Hours, 1/24/4),'<=',1),'hh:mm') & ' <= x < '& time(subfield(class(Incident_FirstUpdate_Hours, 1/24/4),'<',3),'hh:mm')

dana
Creator III
Creator III
Author

Very nice!

Thanks!

Class - Interval fixed.png