Hi,
I am stuck with a problem. I need to restart the running-sum every-time a 0 is encountered.
eg: I need the running sum to look like the "sum" column below. Is it even possible?
name | amount | sum |
a | 1 | 1 |
b | 2 | 3 |
c | 3 | 6 |
d | 4 | 10 |
e | 5 | 15 |
f | 0 | 0 |
g | 1 | 1 |
h | 2 | 3 |
i | 3 | 6 |
j | 4 | 10 |
IF SUM([Amount]) = 0 then 0 else PREVIOUS_VALUE(0) + SUM([Amount]) END