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: 
bwisealiahmad
Partner - Specialist
Partner - Specialist

Calculating Duration of a row of times

Hi,


I have a list of duration times and am wondering how I can sum these up to Days, Hours, Minutes and Seconds. It's a phone log and I am trying to calculate the average and total time spent on the phone. Here is an example of some of the rows:

 

00:00:02
00:00:03
00:00:03
00:00:03
00:00:04
00:00:04
00:00:04
00:00:05
00:00:05

This is hh:mm:ss

Added Excel sheet also with a column of it.

Don't know why, but I keep getting a total of 11 hours and x amounts of hours / mins?

7 Replies
Chanty4u
MVP
MVP

try this

interval(Field, 'D hh:mm:ss') or perhaps interval(interval#(Field, 'hh:mm:ss'), 'D hh:mm:ss'). .

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Capture.JPG

What I get is 0 days, 11 hours, 18mins and 58 seconds. Which sounds very high...

Chanty4u
MVP
MVP

try this

=sum(Interval(Interval#(Time,'hh.mm.ss'),'dd.hh.mm'))

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Returns nothing...

Right now it is formatted in the Load Script as:

Timestamp#(A,'hh:mm:ss') AS A2

Chanty4u
MVP
MVP

remove # and try

Timestamp(A,'hh:mm:ss') AS A2

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Didn't work.  Really appreciate the answers but lets wait and see what other suggestions come in.

I am thinking I might have to make it into seconds and then format that differently.

Chanty4u
MVP
MVP

thanks try this below

=interval(Your_field/24,'D HH:mm:ss')


or


=interval(Your_field, 'd hh:mm:ss')