Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator III

Straight Table vs Pivot Table

Hi ,

I have created a straight table and have chosen Sum of rows as total. And the total is showing correctly. But when i change that straight table to the pivot table the value is getting reduced. I am not changing any expression or dimension it is like a fast change.

My expression is set analysis with count distinct.

 

=COUNT(DISTINCT {<Id={50}>} cid)

4 Replies
Gysbert_Wassenaar

Yes, the pivot table doesn't have a totalling mode you can set, so it defaults to the expression itself. You'll have to use the aggr function if you want the sum. sum(aggr(count distinct {<Id={50}>} cid, MyDim1, MyDim2,... )). Replace MyDim1, MyDim2 ... with all the dimensions of your pivot table.


talk is cheap, supply exceeds demand
brindlogcool
Creator III
Creator III
Author

Thanks Gysbert,

I have modified the expression with aggr function But still it is not giving the same total.

Gysbert_Wassenaar

Works for me. See attached qvw. If you're still unable to solve the problem, post your document (or a representative sample).


talk is cheap, supply exceeds demand
brindlogcool
Creator III
Creator III
Author

Thanks for your response. One more reason is inconsistent across the columns only one column is giving wrong value when converting from Staright to pivot table. But all the other columns are correct.

But if i use the agg function i am getting the wrong value for all the columns.