2 Replies Latest reply on Jul 13, 2017 12:58 PM by Alex Tudose

# dynamic percentage of running totals

Hi,

Please see attachment. The data is structured by month for the most recent 24 months, by company/product with the corresponding sales.

The task is to create a table showing the MAT share for each company, where MAT is the running total of the most recent 12 months - as shown in the workbook named 'MAT'. To get to this point, I used a running total table calculation combined with a date filter calculation. The problem is that I can't use 'percentage of row' to get the desired dynamic MAT share (as percentage of running totals) nor I can use an LOD expression i.e. FIXED. Seems I'm stuck, any help would be greatly appreciated!

Tableau 10.3

• ###### 1. Re: dynamic percentage of running totals

Hi Alex,

So bit of a head-scratcher this one!...

So one(and I think the only!) way to do this is to envoke another Table Calc, and nest the current MAT calculation in it

So I created this calc....

[MAT - Window Sum]

WINDOW_SUM([MAT])

So when we set up the table calulation we can used the nested feature to run MAT and MAT - Window Sum different ways (one over date, and one over company)

So the MAT is run by date as before and MAT - Window Sum by Company

This now gives us the running_total 12 month SUM of each company, so we can just divide one by the other to get the Share of Sales.

Hope that helps, and makes sense.

1 of 1 people found this helpful
• ###### 2. Re: dynamic percentage of running totals

It worked beautifully! Many thanks SImon!

1 of 1 people found this helpful