Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Walakorn
Contributor
Contributor

Rangesum by row in a pivot table

Hi Experts, 

I have a pivot table and want to use the rangesum function, but it only works for 1 dimension when I add more than 1. It doesn't work at all, as the picture below shows.


Please help me to fix this problem.

Sum-Target =   SUM(AGGR( IF( Target - Inventory >0 , Target - Inventory, 0 ) ,MKTName,Memeory,Color,ID) )

Rangesum = RANGESUM( ABOVE ( SUM( AGGR( IF( Target - Inventory >0 , Target - Inventory, 0 ) ,MKTName, Memory,Color,SiteID) ) ,0, RowNo() ) )

 

Walakorn_0-1683687375118.png

 

Many thanks in advance

Best regards,

Walakorn  T.

 

Labels (3)
2 Replies
Chanty4u
MVP
MVP

Try this 

Sum-Target = SUM(AGGR(IF(Target - Inventory > 0, Target - Inventory, 0), MKTName, Memory, Color, ID))

Rangesum = 

    IF(ROWNO() = 1, Sum-Target,

        Rangesum(Above(Sum-Target, 0, ROWNO()-1)) + Sum-Target)

Walakorn
Contributor
Contributor
Author

@Chanty4u 

Thank you for responding, but it still doesn't cumulative sum for two dimensions.

Walakorn_0-1683699560192.png