I have a table and I want to get the cumulative sum within a group(by ID), but the cumulative count should reset if the counter is 0 at any point within a group and again start the cumulative count from 1.
ID Counter Cumulative
A 1 1
A 0 0
A 1 1
A 1 2
B 1 1
B 0 0
B 1 1