12 Replies Latest reply: Aug 29, 2018 12:01 PM by Mark Ritter

# 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

• ###### Re: Need to Sum Results of Interval Function

So, 5.74 is approx. 5 3/4th days... whereas the thousands could mean minutes, right? May be try this

Interval(Sum(ProcessingMinutes), 'm,ss')

• ###### Re: Need to Sum Results of Interval Function

I got 8,265 minutes and 36 seconds when converted 5.74 days to minutes and seconds

• ###### Re: Need to Sum Results of Interval Function

That did not change the result.

• ###### Re: Need to Sum Results of Interval Function

Where are you using this? In a chart? have you over-ridden the default format? Make sure you are going with default so that your expression can be formatted using Interval function.

• ###### Re: Need to Sum Results of Interval Function

I have tried it in a regular table and also in a KPI.  I don't get the correct result in either case.

I want the total to stay in the format of mm.ss and not convert to days or anything else.

• ###### Re: Need to Sum Results of Interval Function

I understand what you want and that is why I suggested you to use Interval() function. Is ~8265 not the right number you are looking to get Mark?

• ###### Re: Need to Sum Results of Interval Function

In a standard table I have no control over the Total calculation.  All I can do is pick Sum.  When I do that I do not get the correct number.

In the KPI I can do what you suggested.  But that is also not returning the correct result.

• ###### Re: Need to Sum Results of Interval Function

Mark, I get that you are not getting what you are looking to get, but I think you are not letting us know what you want? I straight forwardly asked of ~8265 is the number you are looking get, but you ignored to answer that and yet again mentioned that you aren't getting what you wanted. I won't be able to help if you ignore to answer my questions and keep on repeating the same thing over and over my friend.

• ###### Re: Need to Sum Results of Interval Function

Let's say that I have 3 rows of data.

The processing time is 100, 150, 50 for each of those rows (This is in minutes).

I expect the total to be 300 minutes.  Not something like I am seeing now which is some small fraction.

Does that help?  If not, let me know what else I can tell you.  I am stumped.

• ###### Re: Need to Sum Results of Interval Function

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.

• ###### Re: Need to Sum Results of Interval Function

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,

• ###### Re: Need to Sum Results of Interval Function

That appears to be working.  Thank you.