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: 
Not applicable

Unable to get correct Average time Gauge Chart

Hi,

I have a Gauge Chart that looks like a speedometer, which I need to represent my average fix times.  I have a field called (fix_time_true), which pulls out the fix time on each incident.  However in my guage chart, the speedometer shows correct, however in the Presentation Tab -> and text in chart section, I have the following code - =avg(fix_time_true).  However this pulls it out as 0.0464400008 and it should show an average of 1:06:52. 

The fix time is in seconds and in the load script I ran the following ,interval(time(fix_time/86400, 'hh:mm:ss')) as fix_time_true.

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions
Not applicable
Author

Have you already tried somthing simple like =time(avg(fix_time_true))?

View solution in original post

3 Replies
Not applicable
Author

Have you already tried somthing simple like =time(avg(fix_time_true))?

Not applicable
Author

Thanks for the help mrdaan, I was being a bit of an idiot .  I was looking at my times and then trying to work out the average so for example I was trying to work out the average of 00:00:01 and 00:00:03, which obviously would be 00:00:02.  However I forgot that the list box I am using to look at the fix time only contains the distinct time.  I noticed that there was probably 15 00:00:01 and only one 00:00:03. 

In the end I had to run =interval(time(avg(fix_time_true))) as some of my times are over 24 hours.

Not applicable
Author

Jonathan,

on another note. It's advisable to keep your load script as simple and plain as possible, i.e.: in seconds or with timestamps. your fixtime will then be timestamp_end-timestamp_begin which will return an integer. All the necessary formatting can then be done in the front-end, this will save time-consuming errors and keep your scripts simple. It will also allow you to build faster apps.