When I have a list of data (measured per day), is it possible to define a function that gives the nr of days since the data has been 0? I tried working with`Position`to find the 0's but that did not really help me to create a function. 

**Simplified example:**

```
data = {{1, 0}, {2, 1}, {3, 3}, {4, 0}, {5, 1}, {6, 0}};
ListPlot[data, InterpolationOrder -> 0, AxesLabel -> {"time(day)", "data(mm)"}, Joined -> True]

```

![enter image description here](https://i.stack.imgur.com/LtkUV.jpg)

**Result I want:** ( I now entered it myself, but I want to do this for large amounts of data, which makes typing it very time consuming ;)) 

```
result = {{1, 0}, {2, 0}, {3, 1}, {4, 2}, {4,0}, {5, 0}, {6, 1}};
ListPlot[result, AxesLabel -> {"time(day)", "days since last 0"}, 
   Joined -> True]

```

![enter image description here](https://i.stack.imgur.com/fbuTb.jpg)