Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Pivot Table Total based on different column

SchoolSubjectStudentsGradesABCMathab0ABCMathac12ABCMathad32ABDMathae1BBEnglishuu44BBEnglishud0BBEnglishua

33

SchoolSubjectStudentsGrades

SchoolSubjectStudentsGradesClass Total

Variance

ABCMathab105510/55
ABCMathac125512/55
ABCMathad325532/55
ABDMathae1551/55
BBEnglishuu448744/87
BBEnglishud108710/87
BBEnglishua

33

8733/87

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

14 Replies
sunny_talwar

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

Sum(Grades)/Aggr(NODISTINCT Sum(Grades), School)

Capture.PNG

userid128223
Creator
Creator
Author

Hi Sunnny

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

sunny_talwar

I believe it would...

userid128223
Creator
Creator
Author

Class Total

count(TOTAL <School, Subject> Grades) ?

Variance

count (Grades)/Sum(TOTAL <School, Subject> Grades) ?



or do we have to rewrite it differently.

sunny_talwar

More like this

Class Total

Count(TOTAL <School> Grades)

Variance

Count(Grades)/Count(TOTAL <School> Grades)