Hi all,
I am sorry about writing that often today. I really appreciate your help!
The problem is the following: I have a dataset like this:
id quarter salesmnf Year
1 2004q1 0 2004
1 2004q2 0 2004
1 2004q3 9 2004
...
1 2015 q1 0 2015
1 2015 q2 9 2015
1 2015 q3 0 2015
1 2015 q4 5 2015
The same structure is repeated over all products. Now, what I would like to do is to find the first positive occurrence for each year and drop the rows with the 0 above the first occurrence, so that for instance the example will result in:
id quarter salesmnf Year
1 2004q3 9 2004
...
1 2015 q2 9 2015
1 2015 q3 0 2015
1 2015 q4 5 2015
Notice that this is just for the 0s above the first positive occurrence.
many thanks again!!!
I am sorry about writing that often today. I really appreciate your help!
The problem is the following: I have a dataset like this:
id quarter salesmnf Year
1 2004q1 0 2004
1 2004q2 0 2004
1 2004q3 9 2004
...
1 2015 q1 0 2015
1 2015 q2 9 2015
1 2015 q3 0 2015
1 2015 q4 5 2015
The same structure is repeated over all products. Now, what I would like to do is to find the first positive occurrence for each year and drop the rows with the 0 above the first occurrence, so that for instance the example will result in:
id quarter salesmnf Year
1 2004q3 9 2004
...
1 2015 q2 9 2015
1 2015 q3 0 2015
1 2015 q4 5 2015
Notice that this is just for the 0s above the first positive occurrence.
many thanks again!!!
Comment