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: 
SilvioQlik
Contributor
Contributor

Aggr(RangeSum(Above( .... Sorting Problem

 

Good Moning Comunity, I'm Silvio From Italy 

I have this Table :

SilvioQlik_0-1694437969895.png

 

I'm using the following formula to reach a progressive sum of QTA_PLAN for each KCODE ordered in ascending order with respect to the Data_MAD.  But as You can see on the Table the sorting is not correct.... I also tried to create a "chiave" with the concatenated information.. but it doesn't work.

Aggr(RangeSum(Above(sum([QTA_PLAN]), 0, RowNo())),KCODE,Chiave)

Can anyone kindly give me some help?

Thanks in advance

regards

Silvio

Labels (1)
1 Solution

Accepted Solutions
SilvioQlik
Contributor
Contributor
Author

Hi Oleg Thanks a lot for Your support !!!

I use this fromula and It's Work !!!

sum(Aggr(RangeSum(Above(sum(QTA PLAN,),0, RowNo())),
KCODE,
(Data_MAD,(text, Ascending))))

Thanks !!!

silvio

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Silvio,

The image is very small and blurry, but it looks to me like your chart is not sorted the same way you sorted your AGGR, hence the impression that the cumulative sum doesn't work.

Another idea to explore - in the AGGR() function, data is sorted based on the load order. In order to sort data in a particular order, like you need, you should use so called "structured arguments", like this:

Aggr(RangeSum(Above(sum([QTA_PLAN]), 0, RowNo())),

KCODE,

(Chiave, (TEXT, ASCENDING))

)

Or, perhaps you need to replace Chiave the Date field in your AGGR dimensions, to ensure that it's sorted chronologically?

Come to the Masters Summit for Qlik in Dublin this October, to learn advanced AGGR() and Set Analysis  - I'm covering all these questions there!

Cheers,

SilvioQlik
Contributor
Contributor
Author

Hi Oleg Thanks a lot for Your support !!!

I use this fromula and It's Work !!!

sum(Aggr(RangeSum(Above(sum(QTA PLAN,),0, RowNo())),
KCODE,
(Data_MAD,(text, Ascending))))

Thanks !!!

silvio