12 Replies Latest reply: Apr 8, 2016 7:57 AM by Tim Saddler

RangeSum Question in Chart

Hi All

Struggling with the calculation of Cumulatives

As per screenshot , I need cumulatives of 8,16,24,32 for Cum Qnty

Currently I tried rangesum(above(sum(QUANTITY),0,rowno()))

• Re: RangeSum Question in Chart

May be like:

rangesum(above(total sum(QUANTITY),0,rowno()))

• Re: RangeSum Question in Chart

I suspect that you should use

rangesum(above(total sum(QUANTITY),0,rowno()))

HIC

• Re: RangeSum Question in Chart

Won't we need a TOTAL within RowNo() as well?

RangeSum(Above(TOTAL Sum(QUANTITY),0, RowNo(TOTAL)))

• Re: RangeSum Question in Chart

Thanks that was very helpful. How do I keep the cumulative to each order no? Please see screenshot

• Re: RangeSum Question in Chart

Now this makes the the requirement a little more challenging. The problem is that TOTAL identifier within RowNo() cannot be based on certain field (although the help says it can be, but somehow it doesn't work). So now Either you need a field from your script which is sequence of number for each order, or you need to use Aggr() function. Are you using QV12? If you are then the problem can be solved much easily (The sortable Aggr function is finally here!). If not then you again will have to sort your data correctly in the script to resolve this.

In short -> Are you using QV 12? If not, then be ready to make modification to the script.

• Re: RangeSum Question in Chart

Hi thanks for that. I am using Qlikview 11.2.

Can you point me in the right direction of how to do this in the script please?

An example would be great if possible.

Thanks

• Re: RangeSum Question in Chart

This seems to do the trick @Sunny T

Re: Rangesum aggregation script

• Re: RangeSum Question in Chart

Awesome , I am glad you were able to figure it out. I am guessing you won't need a sample anymore?

• Re: RangeSum Question in Chart

Thanks stalwar1 you gave me just info to work it out myself which is great

Problem solved

• Re: RangeSum Question in Chart

Does the accumulation needs to be by OrderNo and Date or Just by OrderNo?

• Re: RangeSum Question in Chart

I'm missing something here because it still doesn't work ? do I need to do something else ?

• Re: RangeSum Question in Chart

Can you try this?

RangeSum(Above(TOTAL Sum(QUANTITY),0, RowNo(TOTAL)))