14 Replies Latest reply: Mar 22, 2017 12:06 PM by Sunny Talwar

# Pivot Table Total based on different column

33

 School Subject Students Grades Class Total Variance ABC Math ab 10 55 10/55 ABC Math ac 12 55 12/55 ABC Math ad 32 55 32/55 ABD Math ae 1 55 1/55 BB English uu 44 87 44/87 BB English ud 10 87 10/87 BB English ua 33 87 33/87

How can i calculate Class Total. will it be formulat or set analysis.

• ###### Re: Pivot Table Total based on different column

Should be like this

Class Total

Variance

• ###### Re: Pivot Table Total based on different column

I think mm has to clarify if it is typo or expecting to be aggr based on School. Coz his school name has ABD (will it be ABC or ABC only) as his total is 55.

• ###### Re: Pivot Table Total based on different column

That seems like a typo... but it might be aggr on School and Subject I think

Class Total

Variance

• ###### Re: Pivot Table Total based on different column

Yes that was typo.

and i am not getting expected results. i believe we may have to use aggr function to get total by school count.

• ###### Re: Pivot Table Total based on different column

in my case i forgot to mention. Class Total field don't exist. I have to determine class total by School name and based on that used the total.

• ###### Re: Pivot Table Total based on different column
 School Subject Students Grades Variance ABC Math ab 10 10/55 ABC Math ac 12 12/55 ABC Math ad 32 32/55 ABC Math ae 1 1/55 BB English uu 44 44/87 BB English ud 10 10/87 BB English ua 33 33/87
• ###### Re: Pivot Table Total based on different column

What is the problem you are facing? Did you try Sunny's below expressions?

Dim:

School

SUbject

Students

Exprs:

ClassTotals

Variance

• ###### Re: Pivot Table Total based on different column

sorry i did not have total field. I was just trying to explain where it was comming from. Your expression don't give me right results. I think we will have to use Aggr function to get this results.

• ###### Re: Pivot Table Total based on different column

What is wrong here my friend?

• ###### Re: Pivot Table Total based on different column

In case Aggr() makes you happy (which doesn't make me happy because it effects performance), you can use this

• ###### Re: Pivot Table Total based on different column

Hi Sunnny

Would the formula work the same way if aggrigation was "Count" and not "SUM"

• ###### Re: Pivot Table Total based on different column

I believe it would...

• ###### Re: Pivot Table Total based on different column

Class Total

Variance

or do we have to rewrite it differently.

• ###### Re: Pivot Table Total based on different column

More like this

Class Total