5 Replies Latest reply on Nov 2, 2018 10:39 AM by Robert Priewe

# Show the grand total in each row (LOD?)

Hi,

i'm trying to create a column that shows the grand total in each item, here is an example what i'm trying to achieve (the column with the 25 in each item:

I think this is done with a LOD calculation but i'm not sure how. The reason i need this column is so I can calculate a ratio between the price in each line item and the grand total.

I've also attached a packaged workbook.

Thanks for the help!

Rob

• ###### 1. Re: Show the grand total in each row (LOD?)

Hi Robert,

Take a look at this series of blogs - Customizing Grand Totals – Part 1 | Drawing with Numbers

HTH

Peter

1 of 1 people found this helpful
• ###### 2. Re: Show the grand total in each row (LOD?)

Create a Calculated Field:

TOTAL(SUM([Price]))

Drag this into View and Right Click----->Compute using Table Down to get the Grand total in each row.

• ###### 3. Re: Show the grand total in each row (LOD?)

Hi,

You may try this,

For Grand total you can use any of the calculation

Option1: {SUM({FIXED [Fruit ID]: SUM([Price])})}

Option2: {SUM([Price])}

For ratio:

{FIXED [Fruit ID]: SUM([Price])} / {SUM([Price])}

Let us know if this help.

Mahfooj

1 of 1 people found this helpful
• ###### 4. Re: Show the grand total in each row (LOD?)

Thank you! When i was experimenting I was close, I tried "SUM({FIXED [Fruit ID]: SUM([Price])})" but didnt know you had to wrap that again with {}

• ###### 5. Re: Show the grand total in each row (LOD?)

Hi Mahfooj, I just realized my real dataset has a further complexity. Lets call it scenario, the same data is repeated twice with a cheap and an expensive scenario, in both the prices for each item are different. I've tried using this:

{SUM({FIXED [Fruit ID], [Scenario]: SUM([Price])})}

But its showing the sum for both scenarios (57 instead of 25):

I know I can add the scenario filter to context and thats going to fix it, but is there a way to do it without adding the scenario to context?

I've attached a new workbook with the scenario in the data

Thanks again for the help, I feel i'm really close to the solution!

Rob

EDIT:
Somehow i managed to get it done!! In case anyone else is looking for a solution, this is how i solved it. Not sure if this is the best way of doing it, but the numbers seem to be fine:

{FIXED [Scenario]: SUM({FIXED [Fruit ID], [Scenario]: SUM([Price])})}