Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incorrect totals in a pivot table

I am getting incorrect totals in my pivot table:

Calendar Year 2009
Beginning Fleet Indicator Calendar Month Jan
Non-Fleet26837
Fleet1941
Total28431


Dimensions are Beginning Fleet Indicator, Calendar Year and Calendar Month. I am using Parial Sum for Beginning Fleet Indicator.

The expression looks like this:

Sum

({$<[Calendar Year] = {$(=Max([Calendar Year]))}, Inforce = {'Y'}>} [Customer Counter])



1 Solution

Accepted Solutions
johnw
Champion III
Champion III

If you're certain you just want the sum of the rows, you should be able to do it by adding the underlined part (untested):

sum(aggr(sum({<[Calendar Year]={$(=max([Calendar Year]))},Inforce={'Y'}>} [Customer Counter])
,[Beginning Fleet Indicator],[Calendar Year],[Calendar Month]))

Pivot tables generally don't do sums of rows. They simply apply the expression again. In this case, do you perhaps have 347 customers that were both fleet and non-fleet in January 2009? I suspect that would cause what you are seeing, as by default, it wouldn't double-count those customers. Might be something else, of course.

View solution in original post

2 Replies
johnw
Champion III
Champion III

If you're certain you just want the sum of the rows, you should be able to do it by adding the underlined part (untested):

sum(aggr(sum({<[Calendar Year]={$(=max([Calendar Year]))},Inforce={'Y'}>} [Customer Counter])
,[Beginning Fleet Indicator],[Calendar Year],[Calendar Month]))

Pivot tables generally don't do sums of rows. They simply apply the expression again. In this case, do you perhaps have 347 customers that were both fleet and non-fleet in January 2009? I suspect that would cause what you are seeing, as by default, it wouldn't double-count those customers. Might be something else, of course.

Not applicable
Author

Great. That did it. Thanks.