Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
bwisealiahmad
Valued Contributor

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
Esteemed Contributor III

Re: Calculating Duration of a row of times

try this

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

bwisealiahmad
Valued Contributor

Re: Calculating Duration of a row of times

Capture.JPG

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

Chanty4u
Esteemed Contributor III

Re: Calculating Duration of a row of times

try this

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

bwisealiahmad
Valued Contributor

Re: Calculating Duration of a row of times

Returns nothing...

Right now it is formatted in the Load Script as:

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

Chanty4u
Esteemed Contributor III

Re: Calculating Duration of a row of times

remove # and try

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

bwisealiahmad
Valued Contributor

Re: Calculating Duration of a row of times

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
Esteemed Contributor III

Re: Calculating Duration of a row of times

thanks try this below

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


or


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

Community Browser