Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

accumulated sum in script

hi all

 in my model , i have a table with transactions quantity

I would want to add a field (Total) to accumulate the  quantity  in level of branch, item, transactions_date - i.e :

DateStoreItemQuantityTotal
31/12/201931776111
02/02/2020317761-10
04/02/202031776111

 

advanced thanks

Labels (4)
3 Replies
Brett_Bleess
Former Employee
Former Employee

I would recommend you attach your QVW file on this one, so folks can see your data model etc.  You really did not provide much to go on, which is likely why you have not received any posts.

Here are a couple of Design Blog posts that may be useful though:

https://community.qlik.com/t5/Qlik-Design-Blog/Accumulations/ba-p/1466581

https://community.qlik.com/t5/Qlik-Design-Blog/Accumulative-Sums/ba-p/1468010

Here is the base URL for this area in case you wish to further search on your own for more posts that may help:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Saravanan_Desingh

One solution is.

SET DateFormat='DD/MM/YYYY';

tab1:
LOAD *, RangeSum(Peek(Total), Quantity) As Total
;
LOAD * INLINE [
    Date, Store, Item, Quantity
    31/12/2019, 3, 17761, 1
    02/02/2020, 3, 17761, -1
    04/02/2020, 3, 17761, 1
];
Saravanan_Desingh

commQV06.PNG