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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
rkspareek1992
Partner - Creator
Partner - Creator

Issue in accumulation in load script

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:

BB:

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:

Inline image 1

Desired Output:


ASum(Sales)Sum(CumSales)
1-100-100
3400300
4-800-500
5-200-700
6200-500

13 Replies
sunny_talwar

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

rkspareek1992
Partner - Creator
Partner - Creator
Author

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.

sunny_talwar

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

sunny_talwar

And just for your future reference

QlikCommunity Tip: How to get answers to your post?