Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Row cumulate (by code)

Dear qlikView community,

I need your help with this issue.

I have table with Purchaising Order, Purchaising Order position, Confirmation Date, Confirmed Quantity.

I need to calculate by code the following value:

for each PO and PO position I need to cumulate the current Confirmed Quantity with the confirmed quantity in the previous row .

See the following tables for more details:

What I have:

POPo positionConf. DateConf Quantity
4400xxx101/06/20125
4400xxx101/07/201210
4400xxx101/10/20123
4400xxx201/07/20127
4400xxx201/08/201220
4400yyy101/01/20134

What I need:

POPo positionConf. Datesum(ConfQ)
4400xxx101/06/20125
4400xxx101/07/201215 (10+5)
4400xxx101/10/201218 (10+5+3)
4400xxx201/07/20127
4400xxx201/08/201227(7+20)
4400yyy101/01/20134

Coul you help me please?

Thank you

1 Solution

Accepted Solutions
Not applicable
Author

try according to this example

Data:

LOAD

Date,

installs as installs_new,

NUMSUM(installs, PEEK('installs', -1)) AS installs;

LOAD * INLINE [

Date , installs

01/01/2011 , 5

02/01/2011 , 4

03/01/2011 , 2

04/01/2011 , 3

05/01/2011 , 2

06/01/2011 , 1

07/01/2011 , 8

08/01/2011 , 5

09/01/2011 , 3

];

see attachement

View solution in original post

4 Replies
Not applicable
Author

Below expression will help you

rangesum(above(sum(ConfQ), 0, rowno()))

Not applicable
Author

Thank you, but the fuction above() works only for charts and not in script.

Do you have any other ideas to help me?
Thank you

Bye

Not applicable
Author

see link

http://community.qlik.com/message/110317

hope this helps you

Not applicable
Author

try according to this example

Data:

LOAD

Date,

installs as installs_new,

NUMSUM(installs, PEEK('installs', -1)) AS installs;

LOAD * INLINE [

Date , installs

01/01/2011 , 5

02/01/2011 , 4

03/01/2011 , 2

04/01/2011 , 3

05/01/2011 , 2

06/01/2011 , 1

07/01/2011 , 8

08/01/2011 , 5

09/01/2011 , 3

];

see attachement