Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative Sum - Total

Hi

I have a situation where I would like to calculate the cumulative sum of a data set and demonstrate it on a pivot table.

The cumulative sum is being calculated using RangeSum, however in a pivot table, the Total's are not being populated.

Is there any way I can see the totals being shown with the last cumulative data

Total.png

The QVW is attached for your reference

Thanks and Regards,

Sulaiman

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

My bad:

If(Dimensionality()=1

,Aggr(RangeSum(Above(Sum([Amount]),0,RowNo(TOTAL))),Product)

,IF(Dimensionality()=0

,Sum(Amount)

,RangeSum(Above(Total Sum([Amount]),0,RowNo(TOTAL)))))

View solution in original post

5 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

You could use Dimensionality():

If(Dimensionality()<2,Sum(Amount),

RangeSum(Above(Total Sum([Amount]),0,RowNo(TOTAL))))

Hope this helps,

Jason

Not applicable
Author

Thanks for the reply. The answer to that on the table is 40 for product A and 110 for product B.

As per the image attached the total for Product B needs to be 150 ( 110 + 40 (from Product A) )

Any idea how ??

Thanks and regards,

Jason_Michaelides
Luminary Alumni
Luminary Alumni

My bad:

If(Dimensionality()=1

,Aggr(RangeSum(Above(Sum([Amount]),0,RowNo(TOTAL))),Product)

,IF(Dimensionality()=0

,Sum(Amount)

,RangeSum(Above(Total Sum([Amount]),0,RowNo(TOTAL)))))

Not applicable
Author

Works like a charm... Thanks a lot Jason : )

Jason_Michaelides
Luminary Alumni
Luminary Alumni

No problem. Please mark a correct answer so the thread is closed.