Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative sum (help)

Hi all,

In Pivot table, I am having issue with rcumulative sum; rangesum(above(sum(QTY),0,RowNo()) ; I have no idea why this forrmula doesn't work as it didn't perform the running sum ( 6th column)

as can see in the attached photo below, I would like to get the cumulative sum by product (the last column)Screen Shot 2017-05-21 at 11.37.23 AM.png

rangesum(above(sum(QTY),0,RowNo())

9 Replies
Digvijay_Singh

Try Total<Product> where you have used Total in expression.

Anil_Babu_Samineni

May be this?

Rangesum(Below(Sum(QTY),0),Above(QTY,1,RowNo()))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

😞 it's stil not working

Showing null value

Not applicable
Author

Value same as rangesum(above sum(qty),0, RowNo()))

Anil_Babu_Samineni

May be check this file? This is bad approach for your output. But, O/P Deserve

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Thanks for your reply

The last output isn't what I want

I wish to get (by product regardless other dimensions)

2

5

9

2

6

9

Anil_Babu_Samineni

I have not tested this?

Aggr(RangeSum(Above(Sum(Qty),0,RowNo(TOTAL))),Product, ORderCode1, OrderCode2)

Similar i got some thing

Running totals per dimension (RangeSum(), sortable Aggr()...)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Do you have QV12 by any chance, if you do then you can do this

1) Script change

LOAD *,

  (ORderCode1+OrderCode2/100) as NewOrderCode;

Load * Inline [

Product, ORderCode1, OrderCode2, ShipDate, Qty

A,101,1,21/5/17,2

A,101,2,21/5/17,3

A,111,1,21/5/17,4

B,104,1,21/5/17,2

B,106,2,21/5/17,3

B,104,2,21/5/17,4

];

and then an expression like this

Aggr(RangeSum(Above(Sum(Qty), 0, RowNo())), Product, (NewOrderCode, (NUMERIC)))

Where I am using a The sortable Aggr function is finally here! which is only available in QV12 and higher

NOTE: Used the attachment from Anil's post (thanks Anil)

Anil_Babu_Samineni

Sample attached, May be helps to you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful