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: 
rittermd
Master
Master

Need to Sum Results of Interval Function

I have the following calculation in my script.  It works perfectly to calculate the time difference.

If (endtime > starttime,

       Interval(endtime - starttime,'m,ss'),0)

                              as ProcessingMinutes,

However, when I attempt to Sum or to a Total in my Table Chart I do not get close to the correct answer.

For example the total based on my filter choices looks like a very large number.(in the thousands)  However, the total that is displayed using Sum(ProcessingMinutes) displays as 5.74.

I suspect it has to do with the result from the interval function and that I need to do some massaging or additional calculations on it before I can Sum it.

Thanks

13 Replies
rittermd
Master
Master
Author

Capture.PNG

Here is a partial screen shot of my table.  You can see that I have values on each row.  However, the total is not the total of these numbers.  I have the Total set to Sum in the properties for this column.  If I change the total to Auto I get a dash with no number at all.

sunny_talwar

Try doing this in the script... so the underlying value is not fraction, but a whole number....

If(endtime > starttime, (endtime - starttime) * 24 * 60, 0) as ProcessingMinutes,

rittermd
Master
Master
Author

That appears to be working.  Thank you.

Vamsi0529
Contributor II
Contributor II

Hi Everyone,

My requirement I have Duration column like Below.

duration second's

00:00:28

00:00:28

00:00:28

00:00:29

00:00:29

00:00:29

 

When I Trying to sum i am getting 00:00:57

Can any one help me sum the above seconds