8 Replies Latest reply on Sep 20, 2016 9:39 PM by Mahfooj Khan

# How to perform a row level calculation first then sum the result

Hi,

I am trying to perform a row level calculation first then sum the result but Tableau aggregated the Mark and Score Index then calculate them.

From the screenshot (Tableau) I would like the Grand Total for Scor77.5 (i.e. summation of Mark * Score Index of each customers).Data:

Tableau:

Calculated Field 1: Score Volume

// This is dynamic as it depends on Mark

// i.e. if Mark is not more than zero then the Score Volume will be zero

IF [Mark] > 0

THEN [VOLUME]

ELSE

0

END

Calculated Field 2: Score Index

SUM([SCORE VOLUME]) / TOTAL(SUM([SCORE VOLUME]))

Calculated Field 3: Score

SUM([Mark]) * [SCORE INDEX]

Really appreciate if someone can show me how to achieve this.

Thanks,

Wayne.

• ###### 1. Re: How to perform a row level calculation first then sum the result

Hi Wayne,

What do you want in the Grand Total?

Thanks and regards,
Kajal

• ###### 2. Re: How to perform a row level calculation first then sum the result

Hi Kajal,

I would like to see the Grand Total as 77.5 that is:

Cust # A001: 70 * 0.25 = 17.50

Cust # A003: 80 * 0.75 = 60

=> 17.50 + 60 = 77.50

Thanks,

Wayne

• ###### 3. Re: How to perform a row level calculation first then sum the result

Is that what you wanted?

workbook (version 9.3) attached for your reference. I've created a separate sheet for grand total.

Some useful links to understand why I took this appraoch

Customizing Grand Totals – Part 1 | Drawing with Numbers

Customizing Grand Totals – Part 2 | Drawing with Numbers

Hope this help. Let me know If you've any query.

Mahfooj

3 of 3 people found this helpful
• ###### 4. Re: How to perform a row level calculation first then sum the result

Hi Mahfooj,

Thank you very much for your help; that's what I need.

Also thanks for the useful links.

Thanks,

Wayne.

• ###### 5. Re: How to perform a row level calculation first then sum the result

1 of 1 people found this helpful

• ###### 7. Re: How to perform a row level calculation first then sum the result

Good morning Manfooj,

I logged in to the Forum site.

No, I did not see a "Correct Answer" button; I see only below:

I click on the Action and it shows "No Actions are available."

So, I thought "This Helped Me YES | NO" was what I need to click.

I am using IE 11 but have tried Edge and there is no "Correct Answer" either.

Thanks,

Wayne

• ###### 8. Re: How to perform a row level calculation first then sum the result

You wont get any option in "Action". If you open your original post in a new tab of your browser then go to the appropriate reply of your post which you seems the correct answer of your question. In that reply just above the action there is a button called "Correct Answer".

Just click on that to close the thread. Else no issue leave it