8 Replies Latest reply on Apr 7, 2016 12:55 PM by Andrei Macari

# Calulate Total over running_sum

Hi everyone

If some one can help to write a calculation of "Total" over "Running_SUM".

Currently I have a such calculation on Daily view, please check screen:

I have one additional tab "Summary", where calculation is done using formula "RUNNING_SUM", where I need also implement "TOTAL"

So it is needed TOTAL calculation field on tab where calculation done using RUNNING_SUM.

Example of project attached.

I'll appreciate any help!

• ###### 1. Re: Calulate Total over running_sum

Hi Andrei,

Looking at this, I'm wondering whether your cancellation count is correct?

Am I right in thinking you are wanting to apply a value of 1 for each status 1? If so you could simply perform a running sum on the logic calc eg (an this is probably best as a two-field calc rather than nested):

[Canx Count] If Status = 1 Then 1 End

[Cumu Canx Count] = Running_Sum(Sum([Canx Count]))

I should add that this should not really make much difference though for clarity this allows you to be a little more flexible in your approach and if you are working with a pre-aggregated source but not a cube, this may help in your definition.

One item that is throwing me is your field [TotalCancelationSummary] with a value of 1234.

What is this field and what are you trying to do with it? As this is the field that you are using for your running sum rather than your dedicated [CounOfCancelDaily] field

Steve

• ###### 2. Re: Calulate Total over running_sum

Hi Steve

Cancellation is calculated correctly. Status =1 then canceled. Status = 0 then NOT canceled.

Steve, could you please provide modified work book?

Thank you.

• ###### 3. Re: Calulate Total over running_sum

I haven't anything to provide until I have completed my assessment.

Steve

• ###### 4. Re: Calulate Total over running_sum

One item that is throwing me is your field [TotalCancelationSummary] with a value of 1234.

What is this field and what are you trying to do with it? As this is the field that you are using for your running sum rather than your dedicated [CounOfCancelDaily] field

[TotalCancelationSummary] is "1234" is just for test, so here I looking for right calculation.

• ###### 5. Re: Calulate Total over running_sum

Hi,

See the calculation. I've Compute using "S Level Key"

Let me know if you have any query.

attached in version 9.2

Mahfooj

• ###### 6. Re: Calulate Total over running_sum

Hi Mahfooj

Unfortunately this did not worked. Lets take an example for Summary view, for February 2016

Essential: 205

Select: 223

So for this specific month there should total cancellation in ToolTip: 472

Thanks

• ###### 7. Re: Calulate Total over running_sum

Mahfooj is on the right track. Create the Window_sum instead of 1234 to be your TotalCancelationSummary: WINDOW_SUM([CounOfCancelDaily]). We'll use that to calculate the total for each month

Create a new calculated field to do a running_sum of the totals for each month: RUNNING_SUM([TotalCancelationSummary]). Set up the TotalCancelationSummary to calculate as follows:

I've attached the solution in 9.2.

1 of 1 people found this helpful
• ###### 8. Re: Calulate Total over running_sum

Thank you Andrew and Mahfooj

That exactly what I need. Level up in Tableau.!