Sample data below.
I need to compute the col_3 based on col_1. It should give me the running sum of col_2 but should reset to 0 if col_2 is zero for a given col_1 value.
col_1 col_2 col_3
A 1 1
A 0 0
A 2 2
A 3 5
A 0 0
B 2 2
B 0 0
B 0 0
B 1 1
B 1 2
↧