Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Total come wrong in Pivot

Hi All,

I have pivot table in that i my totals is not coming properly.

PFA of excel which is taking from pivot table.

Thanks

1 Solution

Accepted Solutions
Kushal_Chawda

try aggr function ,

sum(aggr( YourExpression), Country, Customer))

View solution in original post

8 Replies
Not applicable

Hi,

In this excel which and all fields you are considering for total in your pivot table.

prma7799
Master III
Master III
Author

Hi,

I am taking this output from my pivot table. And i got wrong figure for last three column.

Thanks

Kushal_Chawda

try aggr function ,

sum(aggr( YourExpression), Country, Customer))

prma7799
Master III
Master III
Author

Hi Kush,

I tried your expression i got my expected output also but can you please tell me why this happened.

Thanks

Kushal_Chawda

as in pivot table we don't have some of rows option, total is by default expression total. So to make pivot total to sum of rows we use aggr fucntion to aggragate all the values with respect to each dimension to get the correct total

prma7799
Master III
Master III
Author

Kush141087

So every time we need to take expression with aggr in Pivot table?

But in my pivot table am taking at least 12 dimension then why we take on first to like country and customer.

Please give some suggestion.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

PFA....

Kushal_Chawda

It's not always the case.IF your data model is perfect and no duplicates and expression is simple you will get the correct total. if you have any If condition or you have bit more complex expression you need to use aggr