I'm having trouble figuring out how to calculate a running inventory level based on quantity of an item purchased and sold and few other events. In summary, each day purchases, sales, and other events are recorded per product. I got to the point where I created an inventory table with all available dates for the life of a product, a product ID, purchase price and then quantity that was purchased, sold, etc. each day.
Now I'm at a point where I need to create a calculated column that shows quantity of a product that is available in inventory on a given day. It's very simple to do in Excel, but I'm struggling to get the column created in QlikView script. Attached is the app and a sample spreadsheet that I'm working with. Quantity In Stock (Column J) is what I'm trying to create in script.