10-26-2017 07:30 AM
I'm having an issue with something at the moment which I'd be grateful for some assistance on.
I've a dataset at the moment which has a number of 0 for variable occurrence.
What I would like to do is change where there is a 0 to 1 and subsequently change the 1 to 2 and so on. Below gives a better idea.
Data in current format;
What I would like to occur;
10-26-2017 09:09 AM
If there is an instance of occurrence=0, will it always be for the first observation for an ID?
Here's an approach that makes a reasonable guess about how to handle that question:
if first.ID then increment=0;
if occurrence=0 then increment=1;
occurrence = occurrence + increment;