Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculating Cumulative Sums and Incremental values together

Dear experts,

I am quite new to Qlikview and need help of experienced users about my below issue.

I have a table like that

ItemFileYearQuarterAmount
A1002012150
B10120121100
A1022012260
B10320122250
A1042012355
B10520123300
A1062012465
B10720124400

And I want to calculate the total result with cumulative sums of item A values and incremental value of Item B as per and of quarter of the year.

Year2012201220122012
Quarter1234
Item A50605565
Item B100250300400
Result1504107051115
FormulaValue of 2012 A1 + sum(B1+B2)Value of A2 + sum(B1+B2+B3)Value of A3 + sum(B1+B2+B3+B4)Value of A4 + sum(B1+B2+B3+B4)

I am fine with solutions working over both in load script or as expression. Can someone help me out on this one?

Thank you very much in advance!

14 Replies
Kushal_Chawda

Hi egemenekinci, further if you get the time then try to implement what sunny has suggested and if you find it more easy and efficient then you can any time mark his answer correct and mine as helpful.

sunny_talwar

I agree its not complicated, but joins can sometime be painfully slow. So my question is, do we think that Joins are better than using Set Analysis?

Kushal_Chawda

If joins are not performed on large data set & also joins are not performed combined key then join is always efficient as it brings all the relevant dimensions & measures into single table, but at the same time it increases the application size as underlying symbol table size increases. So that all depends on amount of data and requirement.

Anonymous
Not applicable
Author

I have working with a data around 500K records and actually your solution through join is not so effective... stalwar1‌,'s solution works more quicker as expected.

Kushal_Chawda

egemenekinci‌ you can also mark my answer as helpful if so