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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time interval graph restricted to time stamp not date

Hi,

I am trying to produce a graph that shows when people entered and exited a hospital. I have a TimeStamp for both the entry and exit (EventStartTime and EventEndTime). I want to group the events into 15 minute time intervals. In the script I have achieved this by using:

Time( class( EventEndTime, .25/24))AS End15Interval,

Time( class( EventStartTime, .25/24))AS Start15Interval

These fields do appear to give me what I need. I have then created a line graph with the dimension of DataEventID (each DataEvent has an EventStartTime and an EventEndTime). I then have used the expression:

=COUNT(Start15Interval)

The graph comes out like this:

graphlookissue.png

I was however expecting it to come out with all the values showing just the times and not considering the dates. Similarly I'm surprised that when I create a listbox for Start15Intervals I see lots of the same values appearing.

It feels as though the Start15Interval appears to be just a time value but might actually also include a date stamp which the graph must be picking up.

Any suggestion on how I can resolve this?

Thanks for your help it is greatly appreciated.

Dan

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You have not removed the date component of the data. Time() only reformats it to look like a time, but the underlying value is still a time/date value. Use Frac() to remove the date portion, for example:

Time(class(Frac(EventEndTime), .25/24)) AS End15Interval


HTH

Jonathan


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein