Qlik Community

Qlik Healthcare User Group

A private group is for healthcare organizations, partners, and Qlik healthcare staff to collaborate and share insights.

Highlighted
davordzi1951
New Contributor

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
 
Tags (1)
1 Reply
Employee
Employee

Re: Calculating Time between time stamps

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