Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
davordzi1951
Contributor II
Contributor II

Calculating Time between time stamps

 

We're developing Qlik Sense apps for a hospital and we need help on how to calculate the time difference between STARTTIME and SPECIMENCOLLECTIONTIME  formatted to "hh:mm:ss"? Also how can the results be ranked in a Qlik Sense visualization object? Which visualization chart is appropriate for this?
 
Here is a snapshot of the table we're using.
Timestamp.PNG
 
1 Reply
Dalton_Ruer
Support
Support

If there are 2 things healthcare data is loaded with it's Physician ID's and Timestamps. 

It sounds like what you need is the INTERVAL function. https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Fo...

You simply subtract one TIMESTAMP from the other and then format it the way you want in terms of days, hours, minutes and seconds. 

You can use the function inside of a chart if you wish but I recommend doing that transformation inside the load script. I would also recommend doing something else with the interval other than just displaying it raw. You probably have categories for the values like "0-10 seconds is lightning fast" "10 hours or more is horribly slow." 

The Interval type data can be sorted like any other column. Simply click the column header to order it from smallest interval to largest interval or vice versa. 

Me and Joe Warbington are both big fans of Heat Maps for data like this. What is the average INTERVAL for the data across all 24 hours, 7 days a week? Why? Because everything for hospitals is about patient flow. If there is a bottleneck due to staffing issues in any other that slows that patient flow down it comes to view instantly with a heat map. If you aren't familiar with that check out one of my old blog posts on Visualizing the Busy-Ness