Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

accumulate with load

hi community,

ı have a data as;

stock value , customer ,      term

10                    a              201401

20                    a               201401

30                    b               201402

40                    c               201403

50                    c               201404

how can we make accumulative sum by term, with load statement?

ı want ıt to be seen as:

term           stock value    

201401            30

201402            60

201403            100

201404            150

thanks

15 Replies
Anonymous
Not applicable
Author

ı checked but no....

no solution .....

nothing in hand.

sunny_talwar

Would you be able to share a sample?

john_s_w_wood
Creator
Creator

Just thought I'd check something before I looked at the script?

Do you need to perform it in the script? You can get the result you want in a chart such as a straight table from your original data?

ensure the sort is on term

term as dimension

expression sum(stock value)  but tick accumulate total in the bottom LH corner of expressions.

Anonymous
Not applicable
Author

Ok my friends. It worked.

The problem is CASE SENSITIVITY (upper case problem) ı solved it.

Thank you very much for your helps.

new:

Join(stok)

LOAD STOK_DONEM,

  Sum(STOK_BEDELI) + RangeSum(Alt(Peek('Accumulated Stock Value'), 0))

  as [Accumulated Stock Value]

Resident stok

Group By STOK_DONEM

Order By STOK_DONEM;

that works. thanks.

Anonymous
Not applicable
Author

yes ı tried it but it gives dynamic sum, not static,

when you filter the 'term' it changes the sum,

but we had needed static solutions here.

thanks anyway.

john_s_w_wood
Creator
Creator

you've got your answer so thats good

Its academic now but another way is to use the rangesum and above functions. Ive reproduced your requirement using both the accumulate and the rangesum methods

rangesum(above(sum(stockvalue),0,rowno()))    (doesnt need the accumulate flag)

accum1.JPGaccum2.JPG

Kind Regards