2 Replies Latest reply on Jun 12, 2018 3:48 AM by Ayub Keshtmand

# Running aggregate table calculation

Version: 10.5

Data Source: Sample Superstore

To get a "Running Total" for Sales we would do the following:

What is the equivalent "Running Aggregate" for Profit Ratio?

i.e. We know that Profit Ratio = SUM(Profit) / SUM(Sales)

What I would like is for

1st bar = SUM(Profit)/SUM(Sales)

2nd bar = SUM(1st bar Profit, 2nd bar Profit) / SUM(1st bar Sales, 2nd bar Sales)

3rd bar = SUM(1st bar Profit, 2nd bar Profit, 3rd bar Profit) / SUM(1st bar Sales, 2nd bar Sales, 3rd bar Sales)

So a running aggregate (rather than a running total)

Hope that all makes sense?

• ###### 1. Re: Running aggregate table calculation

Ayub,

I think the best way to accomplish this is by putting the table calculations for each part of the ratio together. It would look something like this:

RUNNING_SUM(SUM([Profit]))/RUNNING_SUM(SUM([Sales]))

-Wesley

• ###### 2. Re: Running aggregate table calculation

Splendid stuff Wesley, not sure why I didn't think of that. Thanks a bunch