#832

Show how each product's stock evolved over time

Same warehouse arrival/shipment event log, but now we need not the final stock but the stock at each point in time — the cumulative sum of deltas from the start up to the current row in time order, separately per product. Show the product id, the timestamp, and the running stock at that moment. Sort by product id, then by time.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

tsdeltabalanceproduct_id
2024-01-01T00:00:00.000Z10101
2024-01-05T00:00:00.000Z-281
2024-01-10T00:00:00.000Z-171

Your query result will appear here