5 Replies Latest reply on Dec 18, 2017 5:54 AM by Danil Nabiullin

# Running sum by three columns

Hi all!

I have to do ABC analysis by three parameters.

For ABC analysis values ranging by parameter, running summing and choosing first 80% - A, 95% - B and other - C.

And I want to create one worksheet with ABC analysis for three parameters - sales, profit and quantity. Like this:

Does anybody have some ideas how to do this it Tableau?

Because I can do it only with one parameter.

• ###### 1. Re: Running sum by three columns

Hi Danil,

Find my approach as reference below and stored in attached workbook version 10.3 located in the original thread.

1. M1. Total Sales: {fixed:sum ([Sales])}

2. M2 Sales Running Sum: RUNNING_SUM(SUM([Sales]))

3. M3. % of M1 . Total Sales: [M2. Sales Running Sum]/sum([M1. Total Sales])

4. M4. ABC Class Sales: if [M3. % of M1 . Total Sales]<=0.8 then "A"

elseif [M3. % of M1 . Total Sales]<=0.95 then "B"

else "C" END

5. Above Measures also for Profit and Quantity (M5 - MM12)

6. Define Parameter

7. D1. Indicator: if [Select Indicator]="Sales" then [Sales]

elseif [Select Indicator]="Profit" then [Profit]

elseif [Select Indicator]="Quantity" then [Quantity]

END

8. Customer Name > Right Click > Text menu > Sort

Regards,

Norbert

• ###### 2. Re: Running sum by three columns

Thanks Norbert, nice guest!:)

But it necessary to have ABC-class for all parameters simultaneously.

In your case we have only one right ABC-class.

Also, I want to have recommendation according to these classes. For example

ACA - "You should increase your price".

For this case it's necessary to have right ABC-class for all parameters.

• ###### 3. Re: Running sum by three columns

Also, it's more simple to have one column with ABC-class, which will be depended on parameter.

IF parameter = sales THEN  M4. ABC Class Sales

ELSEIF parameter = profit THEN  M4. ABC Class Profit

.....

• ###### 4. Re: Running sum by three columns

Hi Danil,

To my best knowledge they are there.....or did i miss something completely;)

Regards,

Norbert

• ###### 5. Re: Running sum by three columns

Yes, but I mean one column with ABC instead three. Because other two isn't correct.

But anyway, your case works only for selected parameter. And it have "A" for costumer with profit -\$6.626 and "B" with \$2.616.