Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
asmithids
Partner - Creator II
Partner - Creator II

Calculating Running Total In Pivot Table

Hello,

Attached is an app that shows all of the inventory activity for items in each store (i.e. beg bal, sales, transfers in&out, adjustments).  I am trying to create a running balance column for each item in each store.  I used AGGR in the pivot table to isolate each transaction quantity per store, item and transaction type.  I am trying to use AGGR in the pivot table also to calculate the running balance by aggregating the beginning balance of each item per store with the sales, transfer and adjustment activity per store. 

I am not seeing where the problem is in calculating the running balance.  I tried creating the running balance calculation in the pivot table and in the load script. 

Thank you in advance for any assistance with this issue!

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Alex,

Not 100% sure if this is what you are looking for?

Miguel

View solution in original post

4 Replies
Gysbert_Wassenaar

Perhaps this document helps: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
asmithids
Partner - Creator II
Partner - Creator II
Author

Hi Gysbert,

Thank you the document.  It did provide some help.  I am using the following calculation as per the document. 

Sum(Aggr(rangesum(above(sum(SalesQTY),0,1) ),ItemID,STORE))


The issue now is that the accumulation is doubling the result per ItemID per STORE.  See attached image.  Any thoughts as to why the result is doubling? 


Thank you,

Miguel_Angel_Baeyens

Hi Alex,

Not 100% sure if this is what you are looking for?

Miguel

asmithids
Partner - Creator II
Partner - Creator II
Author

Thank you Miguel.  We came to the same resolution.     The app is working now.

Thank you again!