I have an inventory transaction BigQuery table as follows (apologies for not being able to post images).
The balance calculation is required periodically and is part of the table.
Expected result is an additional column containing stock balance on the day the calculation is done.
Thanks in advance for any thoughts.
I think a better table structure is to have the stock balance as part of your default columns and just add another one that will hold the date/ timestamps of the period it was calculated.
What will happen is, whenever a calculation is made, the system will record its date/ timestamp. I believe this method needs lesser codes/ queries to write and will allow you to track the periods of your calculations.