Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :
Date | Store | Item | Quantity | Total |
31/12/2019 | 3 | 17761 | 1 | 1 |
02/02/2020 | 3 | 17761 | -1 | 0 |
04/02/2020 | 3 | 17761 | 1 | 1 |
advanced thanks
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
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
];