4 Replies Latest reply on Jan 28, 2013 7:45 AM by Joshua Milligan

# sum of two columns into a third column in table

Hi,

I have a pivot table which shows grade in rows, categories in columns and percentage of each category as values for example see the below table. So I have to show Grade, categories in each grade (outstanding, excellent etc) and percentage of students in each category of performance in each grade. The fields are below

PerformanceCategory

Performance% (Performance percentage calculation)

OutstandingexcellentgoodaverageOutstanding+Excellent
120%10%30%40%?
210%20%20%50%?
310%10%20%60%?

I have a pivot chart as above in my tableau report. Now I want to add another category which is the sum of excellent+outstanding categories.  I have created another measure which sumsup the percentage of excellent + outstanding students. However The issue is that how can I show the extra measure as the last column (Outstanding+exellent). If I have to show it without adding the extra measure, then how can I do that?

When I add the extra measure, it just messesup the shape of the pivot table and does not show up as the last column above

Any help will be appreciated here

Regards

Shah

• ###### 1. Re: sum of two columns into a third column in table

Sayed,

I've attached a worksheet to show one possibility for getting what you are looking for.  It uses a custom hierarchy to allow you to see the sum of Outstanding and Excellent.  It includes notes as as to how it works.

It was the simplest way to accomplish what I perceived was your goal.  Please let me know what you think.

Joshua

• ###### 2. Re: sum of two columns into a third column in table

Hi Joshua,

Many thanks for the help. You are probably close to what I need, but my requirement is a bit more complex than that. If I need to show outstanding and excellent as separate columns as well as show their percentage sum (excellent+outstanding), then how can I show that?

120%10%30%40%30%
210%20%20%50%30%

so as you can see, the last column percentage is the sum of outstanding and excellent category students percentage. Can you please check how to show this

Regards

Syed

• ###### 3. Re: sum of two columns into a third column in table

Syed,

Here's another possibility using table calculations.  It gets exactly what you are looking for with another column.  It has some advantages and some disadvantages over my previous example.  On the positive side, it is much more flexible and allows you to even do things like have a different color for the text of Excellent & Outstanding (which I demonstrate in the attached workbook.)  On the negative side, it is more complex.  Please let me know if you have any questions about what I did.  Thanks!

• ###### 4. Re: sum of two columns into a third column in table

Sayed,

One more possibility is to use a customized Grand Total calculation (check out this link for more information: http://drawingwithnumbers.artisart.org/customizing-grand-totals-part-2/)

Personally, I like this solution a lot better than my previous one.  It is far easier to understand and uses only a couple of  calculated fields.

Joshua