I'm struggling with a problem here. I have a table with the monthly changes in accounts that I want to use to display the monthly balance and to do this I figure I need to sum up all previous periods and add the starting balance. I can solve this mathematically but have problems writing a script for it. (I'm not an experienced programmer)
In my example script I have the column named value that contains the sum of changes within the period. Some basic parameters I need to think of when writing this is:
Period 0 is the years starting balance
I have several years and several divisions
I can choose to use either a starting balance from the first year in my table and sum all changes after or use the 0-period value for each year as a new starting balance.
I would very much appreciate your advices of how to proceed with this.
I've tried using IF / previous along with order by to solve this but I know there must be a more efficient way to do this, maybe with a loop. Nobody that understands my problem?