Hi Glen,
One of the option is to persist the inventory snapshots in a custom table. You can join the Stock Movement table with the calendar and generate daily / weekly snapshots. Each snapshot can be generated with the reference of the previous snapshot and sum of movements during the snapshot period. If you decide to have the weekly snapshots, then each week snapshot would be snapshot for previous week + movements in that particular week.
For the daily snapshot, each snapshot can be generated with reference to the previous day snapshot and movements for the day. If there are no movement documents generated for a given date, the the previous snapshot can be copied over. But in this process, the no of records generated would be quite high.
You can also agree with the business users to store the snapshots for a specific time period (6 months - 1 year) and delete all the previous snapshots to reclaim the memory.
Another option could have been joining day level Calendar with the Stock movement (left outer join) and then summing up all the stock movement quantities to a particular date. But if you need to display the stock for a range of dates, then the join has to materialize high volume of data resulting in negative impact on the performance.
I'd recommend the snapshot option as the data is persisted and has very high performance for query.
Regards,
Ravi