Qlik Community

Qlik Sense Cloud Discussions

Highlighted
lewisjackson_eq
New Contributor II

AGGR on a RangeSum

Hi, I'm trying to put an aggr on the following:

Rangesum(Above(TOTAL if(isnull(No_Of_Assessments_Actual) = '-1', 0,No_Of_Assessments_Actual),0,( rowno(TOTAL))))

This correctly accumulates the value of a field in the table, but I want it to reset whenever the CustomerName changes and start the totalling again based on that customer.

Could someone point me in the right direction? every way I've tried just comes up with the incorrect values.

6 Replies
YoussefBelloum
Esteemed Contributor

Re: AGGR on a RangeSum

Hi,

try this:

Sum(Aggr(Rangesum(Above(TOTAL if(isnull(No_Of_Assessments_Actual) = '-1', 0,No_Of_Assessments_Actual),0,( rowno(TOTAL)))), Customer_field))

lewisjackson_eq
New Contributor II

Re: AGGR on a RangeSum

Screenshot_9.png

Unfortunately that hasn't worked. It just comes out with some weird numbers. Each colour in this pictures represents a different customer, so I am expecting the 'No of Ass. (Actual) Accumulation' to be:

2

11

1

1

2

Would you have any other thoughts?

YoussefBelloum
Esteemed Contributor

Re: AGGR on a RangeSum

your working expression :

Rangesum(Above(TOTAL if(isnull(No_Of_Assessments_Actual) = '-1', 0,No_Of_Assessments_Actual),0,( rowno(TOTAL))))


refers to which column ? No of Ass (Acutal) Accumulation ?

lewisjackson_eq
New Contributor II

Re: AGGR on a RangeSum

Correct. If I put this in the values come out as follows:

YoussefBelloum
Esteemed Contributor

Re: AGGR on a RangeSum

so the accumulation by customer will reflect only on the yellow one ? and you will have this:

2

11

1

1

2

16

right ?

lewisjackson_eq
New Contributor II

Re: AGGR on a RangeSum

Yes, that is what I am after