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 Format Problem in Chart (Need Days, Hours, Minutes)

Hi community,
I have a time formatting problem.  To put it simply, I use a custom database function to compare two dates for very order such as order date and close date and return the difference in business days, hours, minutes seconds.  The return value (Difference) is loaded into the dashboard via the load script. However note that the return format of this function is as follows:'

For example

Order_Code            Order Date            Closed Date               Difference

1234                       2014-03-20 15.02     2014-03-02 10.51         9 05:40:27

Which means it took 9 business days, 5 hours and 40 minutes etc to complete the order. This works fine for one order, but in a chart the difference does not aggregate for a customer like average.  Using an average function will return null at the customer total order level so it won't compute.

I've looked at the Timestamp# function but cannot make it work at the aggregate level. For example if there were ten order, what would be the average difference in days, hours and minutes.  Any ideas?

Any help would be appreciated.

Thanks.

Don Saluga

6 Replies
maxgro
MVP
MVP

maybe with

=avg(Interval#(Difference, 'D hh:mm:ss'))

then you can format in number tab (interval)

Not applicable
Author

Thanks Massimo.

I tried it but it is still returning " - " at the aggregate level.

Chart.png

maxgro
MVP
MVP

could you post some rows of your table?

Not applicable
Author

Below is the result I am getting for one customer. Note the nulls at the summary level.

Client NameClient CodeOrder CodeOrder DateHC Sent Dte Order to AssignOrder to Appt.Appt to Prelim RcvdOrder to Prelim RcvdOrder to Completion
-----
AMERICAN ADVISORS GROUPAAPMCP104557724/4/20144/15/20144  05:31:504  02:52:051  07:38:281  07:38:287  04:22:05
AMERICAN ADVISORS GROUPAAPMCP104655224/9/20144/23/20141  03:51:587  03:43:071  07:24:231  07:24:2310  02:18:05
AMERICAN ADVISORS GROUPAAIRCP104662454/9/20144/17/20140  00:58:242  01:15:002  07:30:002  07:30:005  05:16:17
AMERICAN ADVISORS GROUPAAPMCP104665974/10/20144/17/20140  02:53:322  04:26:582  04:52:072  04:52:075  05:49:53
AMERICAN ADVISORS GROUPAAPMCP104683734/11/20144/18/20140  03:24:253  02:59:571  07:29:161  07:29:165  06:29:57
AMERICAN ADVISORS GROUPAAPMCP104790354/16/20144/21/20140  02:17:541  03:17:541  00:56:221  00:56:223  02:17:54
AMERICAN ADVISORS GROUPAAPMCP104792754/16/20144/23/20140  07:30:302  05:33:571  01:35:181  01:35:184  07:55:19
Not applicable
Author

I'm not sure that the day, hours, minutes and seconds can be averaged in this format.

maxgro
MVP
MVP

in the attachment I made an average by client code of your table

hope it helps