Hello all, I have a large, long dataset with dated events by ID number. I'd like to create an enumeration variable for each event called Event_Number. However, I'd like the enumeration variable to group dates that are within 180 days of each other. I have struggled all day to try to figure out a way to do this with no luck. Any help? In the sample data (code below) you can see that ID 01 has two events within 180 days, but they are currently numbered as two separate events. I'd like both events for ID 01 to be enumerated as the same event ("1"). The same issue occurs again for ID 22 for events 5 and 6. I'd like both events 5 and 6 to be counted as one event ("5"). I read a post on creating sample data but I'm not sure if I've done that correctly: Create table events(ID varchar(6), date float, event_number float); Insert into events(ID, date, event_number) Values('01', 05/11/1960, 1); Insert into events(ID, date, event_number) Values('01', 06/30/1960, 2); Insert into events(ID, date, event_number) Values('04', 07/31/1995, 1); Insert into events(ID, date, event_number) Values('22', 11/26/1969, 1); Insert into events(ID, date, event_number) Values('22', 07/06/1981, 2); Insert into events(ID, date, event_number) Values('22', 07/14/1986, 3); Insert into events(ID, date, event_number) Values('22', 03/25/1992, 4); Insert into events(ID, date, event_number) Values('22', 03/25/1992, 4); Insert into events(ID, date, event_number) Values('22', 09/02/1993, 5); Insert into events(ID, date, event_number) Values('22', 09/15/1993, 6); Thanks for your help!
... View more