Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
asmithbi
Contributor 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

Re: Calculating Running Total In Pivot Table

Hi Alex,

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

Miguel

4 Replies

Re: Calculating Running Total In Pivot Table

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


talk is cheap, supply exceeds demand
asmithbi
Contributor II

Re: Calculating Running Total In Pivot Table

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,

Re: Calculating Running Total In Pivot Table

Hi Alex,

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

Miguel

asmithbi
Contributor II

Re: Calculating Running Total In Pivot Table

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

Thank you again!

Community Browser