Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
PO | Po position | Conf. Date | Conf Quantity |
---|---|---|---|
4400xxx | 1 | 01/06/2012 | 5 |
4400xxx | 1 | 01/07/2012 | 10 |
4400xxx | 1 | 01/10/2012 | 3 |
4400xxx | 2 | 01/07/2012 | 7 |
4400xxx | 2 | 01/08/2012 | 20 |
4400yyy | 1 | 01/01/2013 | 4 |
What I need:
PO | Po position | Conf. Date | sum(ConfQ) |
---|---|---|---|
4400xxx | 1 | 01/06/2012 | 5 |
4400xxx | 1 | 01/07/2012 | 15 (10+5) |
4400xxx | 1 | 01/10/2012 | 18 (10+5+3) |
4400xxx | 2 | 01/07/2012 | 7 |
4400xxx | 2 | 01/08/2012 | 27(7+20) |
4400yyy | 1 | 01/01/2013 | 4 |
Coul you help me please?
Thank you
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
Below expression will help you
rangesum(above(sum(ConfQ), 0, rowno()))
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
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