Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mcowley
Contributor II
Contributor II

Qlik Interval - Rounding to Seconds only floors

Hi All,

We're working on some call center metrics, and I cannot get my expression to round to the nearest second.

In this example, we have a tolal of 1270 seconds of call time over 24 calls.  That equates to 52.92 seconds per call.  

When calculating (and formatting) this a the seconds duration level, i would expect it to round to 53, but Qlik gives me the floored 52.

I've tried a number of data type, function (rounding), and formatting options, but can't get anything to perform the way i expect.

Any advice?Minute Rounding Error.png

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It seems like you have the rounding to seconds figured out but are struggling with combining this with interval. Take your rounded seconds and interpret them as seconds using Interval#(...,'s'). Then format as duration using with the property panel Number Format or wrap the expression in Interval(..., 'hh:mm:ss').

Interval#(Round(sum(totalhandletime)/sum(callshandled)), 's')

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It seems like you have the rounding to seconds figured out but are struggling with combining this with interval. Take your rounded seconds and interpret them as seconds using Interval#(...,'s'). Then format as duration using with the property panel Number Format or wrap the expression in Interval(..., 'hh:mm:ss').

Interval#(Round(sum(totalhandletime)/sum(callshandled)), 's')

-Rob

mcowley
Contributor II
Contributor II
Author

Thanks, as always, Rob.  You truly are kind, generous, and a life saver!