20 Replies Latest reply: Jul 7, 2015 1:27 PM by Sunny Talwar

# Cumulative Averages

How do I get a value for the cumulative value of any given ratio? I am computing Manufacturing Profit Margin % = Manufacturing Profit / Total Sales. I am trying to write an expression that will sum compute the overall value by taking Manufacturing Profit 1 + Manufacturing Profit 2 +Manufacturing Profit 3 / Total Sales 1 + Total Sales 2 + Total Sales 3 = Cumulative Manufacturing Profit Margin % for periods 1-3.  Any help?

• ###### Re: Cumulative Averages

Not sure I completely understand, do you have sample data or app that we can look at?

Best,

Sunny

• ###### Re: Cumulative Averages

I simply want to cumulate the numerator and denominator before dividing to get the overall values of each.

• ###### Re: Cumulative Averages

Try this:

RangeSum(Manufacturing Profit 1 + Manufacturing Profit 2 +Manufacturing Profit 3)/RangeSum(Total Sales 1 + Total Sales 2 + Total Sales 3)

• ###### Re: Cumulative Averages

Or simply do this (but this might give you problems when you have nulls). RangeSum would be a better solution I believe.

(Manufacturing Profit 1 + Manufacturing Profit 2 +Manufacturing Profit 3)/(Total Sales 1 + Total Sales 2 + Total Sales 3)

Best,

Sunny

• ###### Re: Cumulative Averages

No that didn't work, here is what I have thus far, and it is still not calculating. I am using full accumulation, and will need to calculate my cumulative margin similar to what's attached in Excel.

=Sum({\$<[Finance Data.Metric]={'Manufacturing Profit'}>} [Finance Data.Act/Fcst])
/
Sum({\$<[Finance Data.Metric]={'Total Sales'}>} [Finance Data.Act/Fcst])

• ###### Re: Cumulative Averages

The file you attached is already accumulating Metric 1 and Metric 2? I wouldn't be able to help you if you don't give me a sample from raw data. I am not sure what exactly are you doing for accumulation. I hope that make sense.

Best,

Sunny

• ###### Re: Cumulative Averages

Here is a better example:

 Month 1 2 3 Total Metric 2 23996 47980 33692 105668 Metric 1 6245 12489 22108 40842 Margin 0.260252 0.260296 0.65618 0.386512 This is what I want
• ###### Re: Cumulative Averages

Give me sometime... checking it in a bit.

Best,

Sunny

• ###### Re: Cumulative Averages

Check this out:

Script:

Table:

Month, Metric, Value

1, Metric 1, 23996

1, Metric 2, 6245

2, Metric 1, 47980

2, Metric 2, 12489

3, Metric 1, 33692

3, Metric 2, 22108

];

Expression1: =Sum({<Metric = {'Metric 1'}>}Value)

Expression2: =Sum({<Metric = {'Metric 2'}>}Value)

Expression3: =Sum({<Metric = {'Metric 2'}>}Value)/Sum({<Metric = {'Metric 1'}>}Value)

Does this help?

• ###### Re: Cumulative Averages

Still no luck, Im getting the following, when I want to display the following values. I'm importing the numerator and denominator separately, summing them each month, and dividing the cumulative sum each month to mark the YTD margin %.

 0.260252 0.260296 0.65618 0.480691 1.48263 0.863829 2.40551 1.46221 2.98186 1.6341 3.67166 2.01794

Example: Desired End Data and Current Chart

• ###### Re: Cumulative Averages

Can you give me non cumulative data so that i can do it from scratch for you Michael?

Best,

Sunny

• ###### Re: Cumulative Averages

See attached file

• ###### Re: Cumulative Averages

Any luck?

• ###### Re: Cumulative Averages

Going to look at it know ... Sorry got busy with some meetings

• ###### Re: Cumulative Averages

Can you verify that is this what you are trying to do?