Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cumulative week sum aggregated at Quarter Level?

Hi,

Can someone help getting cumulative week sum to aggregate at Quarter level. This expression will be part of table which can be converted to a straight table from a pivot table or viceversa.

Also, when in the middle of the quarter, it should accumulate until that week in the quarter.

When user selects just quarters then it should just show the cumulative sum .@

I really appreciate you taking time to help with this:)

   

YYYYQYYYYWKSumCumulative Sum(Expected Results
201712017017777
2017120170296173
2017120170387260
2017120170483342
2017120170571414
20171201706108522
2017120170795617
2017120170897714
2017120170987801
20171201710102903
20171201711991002
201712017121161118
201712017131391257
201722017148383
2017220171592176
2017220171692268
2017220171798366
2017220171882449
20172201719102551
2017220172097648
20172201721106754
2017220172299853
20172201723104957
201722017241091067
201722017251151181
201722017261301311
201732017279090
2017320172892181
2017320172993275
20173201730102377
20173201731105482
2017320173299581
2017320173399679
20173201734102782
20173201735104886
201732017361161001
201732017371071109
201732017381191228
201732017391471375
201742017407878
20174201741103181
20174201742112292
2017420174388380
2017420174479460
20174201745106565
20174201746102667
20174201747106773
20174201748104877
20174201749116993
201742017501111105
201742017511171221
201742017521441366
5 Replies
sunny_talwar

If you can make changes in the script, I would suggest taking a look here

The As-Of Table

Anonymous
Not applicable
Author

Is there a way to do it in the Chart itself ?

sunny_talwar

May be this

Aggr(RangeSum(Above(Sum(Sum), 0, RowNo())), YYYYQ, YYYYWK)

Or this if you are using QV12 or above or Qlik Sense

Aggr(RangeSum(Above(Sum(Sum), 0, RowNo())), YYYYQ, (YYYYWK, (NUMERIC)))

Anonymous
Not applicable
Author

It breaks if I select a particular week or if the week is not in the table.

sunny_talwar

For selection of week... try this

Aggr(RangeSum(Above(Sum({<YYYYWK>}Sum), 0, RowNo())), YYYYQ, YYYYWK)

Aggr(RangeSum(Above(Sum({<YYYYWK>}Sum), 0, RowNo())), YYYYQ, (YYYYWK, (NUMERIC)))