Forum Discussion

Drobinson1's avatar
Drobinson1
Helper III
8 years ago

Running balance total

I have a current inventory quantity and wanted to be able to calculate balances throughout time based on historical movement quantities.

 

In this example I know the current starting quantity of 7.  I also know all of the movements since a certain archive point.

 

I would like to calculate the ending/starting balance.  Again all I have is the current balance on hand as of right now and three columns of part code/date/ic_move_quantity.

 

I want to calculate the starting and ending balances after each ransaction.

 

to do this I think I need to find what the most recent transation was and go backwards from there.   I am using direct query and can' figure out how to do this since I can't use variables and calcualte in a column.

 

 

 

Part CodeDateIc_Move_QuantityStarting BalanceEnding
BUMESPEP10/20/2017-961037
BUMESPEP10/19/2017-25128103
BUMESPEP10/18/20171280 

 

3 Replies