The idea is that I have one column Amount
which holds both negative and positive numbers. I would like to calculate Balance
for each row that will have the the previous amount plus the value inside Amount
for example
| Amount | | Balance |
+--------+ |---------+
| +5 | | 5 | -- Initial balance should be 0
| +100 | | 105 |
| -10 | | 95 |
What I would like to ask is what should be the method or the algorithm used to calculate Balance
?