Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
swarup_malli
Specialist
Specialist

Implement cumulative sum in pivot table

Hi,

I have a Pivot table which uses advanced set analysis

It has been converted into a cross table.

Currently the Table looks like this (see fig below)

Cumulative 1.png

The resulting chart table should look like (see below)

cumulative 2.png !

1 Solution

Accepted Solutions
sunny_talwar

This seems like what you want:

Capture.PNG

Expression:

=RangeSum(Before((Sum({<REPORT_YEAR={2014}>}FLIGHT_HRS)/COUNT({<REPORT_YEAR={2014}>} AC_SERIAL) * COUNT({<REPORT_YEAR={2014}>} AC_SERIAL)) -

Before(TOTAL (Sum(FLIGHT_HRS)/COUNT(AC_SERIAL)) * COUNT(AC_SERIAL)), 0, 2))


Also attaching your qvw for reference.

Best,

Sunny

View solution in original post

5 Replies
petter
Partner - Champion III
Partner - Champion III

2015-06-12 #2.PNG

swarup_malli
Specialist
Specialist
Author

Thanks for the response Petter

I was looking for cumulative sum ,the app You attached has a calculated dimension

sunny_talwar

This seems like what you want:

Capture.PNG

Expression:

=RangeSum(Before((Sum({<REPORT_YEAR={2014}>}FLIGHT_HRS)/COUNT({<REPORT_YEAR={2014}>} AC_SERIAL) * COUNT({<REPORT_YEAR={2014}>} AC_SERIAL)) -

Before(TOTAL (Sum(FLIGHT_HRS)/COUNT(AC_SERIAL)) * COUNT(AC_SERIAL)), 0, 2))


Also attaching your qvw for reference.

Best,

Sunny

swarup_malli
Specialist
Specialist
Author

Wow !

That was some serious advanced analysis

Great Job ! my friend

sunny_talwar

I did not do much there, just used your expression and wrapped around it the RangeSum(Before()) function..., but I am glad we were able to figure it out.

Best,

Sunny