Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have issue in accumulation at back end, when I am loading negative values, I am unable to get desired output.
Below are the script, qlikview output and desired output.
Kindly suggest.
Script:
LOAD * INLINE [
A,B,C,D, Sales
1,q,r,e, 200
1,q,w,e, -300
3,p,o,i,400
4,p,k,j,100
4,p,k,j,-900
5,v,b,n,-200
6,e,d,x, 200
];
CC:
LOAD
*,
Rangesum(Sales,Peek('CumSales')) as CumSales
Resident BB;
DROP Table BB;
Qlikview output:
Desired Output:
A | Sum(Sales) | Sum(CumSales) |
1 | -100 | -100 |
3 | 400 | 300 |
4 | -800 | -500 |
5 | -200 | -700 |
6 | 200 | -500 |
Two ways
1) Do it on the front end (you can take care of selection in date using set analysis. If you need help, provide a sample where you have dates and we might be able to help)
2) Create multiple accumulated tables for each of your dimension (wouldn't advice you to do this, but in the script, that is the only option available)
HTH
Best,
Sunny
Thanks to both of you for your valuable time.
But I cannot use both of the methods.
Kindly check if there is any other methods.
I hope someone else might be able to help you out, but with the limited information you have been providing I won't be of much help.
All the best
Best,
Sunny
And just for your future reference