Hi, I have a simple question. I would like to have a cumulate sum that restarts if observing 0 in the original column. I have a simple example. Is there an easy way to do this? I tried several ways to do this, but couldn't figure out a way to do this.

ex)x is a column of original data and y is the desired outcome

x y
1 1
1 2
1 3
1 4
1 5
0 0
1 1
1 2
1 3
1 4