Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
JLB
Contributor II
Contributor II

Problem with cumulative sum in pivot table when change sorting

Hello, 

I need your help regarding the problem below : 

I created a pivot table with :

-1 dimension : Source Loc Country (=Country code) 

- 2 mesures :

   Spend by Country => Expression = Sum([Spend In €]) 

   Cumul Spend By Country => Expression = RangeSum(Above(TOTAL sum([Spend In €]),0,Rowno(TOTAL)))

JLB_0-1658408741974.png

So far, it works. 

But when I want to sort by 'Spend by country' (desc) instead of 'Source Loc Country' (alpha asc), I have this 2 second pivot table : 

JLB_1-1658409090508.png

What can I change to have a cumulation according to the 'Spend by country' and not the 'country code' ?

Thanks for your help!

JL

Labels (4)
1 Solution

Accepted Solutions
JLB
Contributor II
Contributor II
Author

Hi, 

One of my colleagues found the solution. It was enough to add the formula 'Sum([Spend In €])' in the sorting by expression of 'Source Loc Country'

JLB_0-1658912005049.png

 

View solution in original post

3 Replies
edwin
Master II
Master II

i think you are supposed to use before and not above for pivots.  look for a prior posting re this

JLB
Contributor II
Contributor II
Author

Hi Edwin,

I did it before, and it does not work with 'before'.

JLB
Contributor II
Contributor II
Author

Hi, 

One of my colleagues found the solution. It was enough to add the formula 'Sum([Spend In €])' in the sorting by expression of 'Source Loc Country'

JLB_0-1658912005049.png