# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

New Contributor III

## 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.

1 Solution

Accepted Solutions
MVP

## Re: Pivot Table Total based on different column

What is wrong here my friend?

14 Replies
MVP

## Re: Pivot Table Total based on different column

Should be like this

Class Total

Variance

Esteemed Contributor III

## 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.

MVP

## 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

New Contributor III

## 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.

New Contributor III

## 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.

New Contributor III

## 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
Esteemed Contributor III

## 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