I'm having an issue in implementing the cumulative sum of previous balance with the new balance please help. The Input is below
Date | Id | Input | Spent |
---|---|---|---|
20230301 | 3 | 1000 | 200 |
20230302 | 3 | null | 100 |
20230303 | 3 | 500 | 100 |
Output Expected
Date | Id | Input | Spent | Output |
---|---|---|---|---|
20230301 | 3 | 1000 | 200 | 800 |
20230302 | 3 | null | 100 | 700 |
20230303 | 3 | 500 | 100 | 1100 |
Since the Date '20230303' had new input the previous balance should be added with the new input to calculate the Output. Please Advise
Thanks in Advance