Hello, Can anyone provide a code that can help me remove multiple occurences from a certain field, if a condition is met. To be more clear, here is an exampl of my data set: Member_ID Effective_date End _date Reason 1234 01JUL2019 31AUG2019 Backed out 1234 01SEP2019 31OCT2019 Re-enrolled 1234 01SEP2019 31OCT2019 Continuous enrollment 2345 01JUL2019 31JUL2019 Cancelled membership 3456 01SEP2019 30SEP2019 Cancelled membership 4567 01JUL2019 31JU2019 Backed out In the above sample data, I want to count number of occurences for member_ID and if there occurs more than 1 occurence of member_ID, I want to compare the effective_dates for that ID. Condition: If the effective_date is repeated for each member_ID in the occurences, then remove the duplicates. Final output that I expect: Member_ID Effective_date End _date Reason 1234 01JUL2019 31AUG2019 Backed out 1234 01SEP2019 31OCT2019 Continuous enrollment 2345 01JUL2019 31JUL2019 Cancelled membership 3456 01SEP2019 30SEP2019 Cancelled membership 4567 01JUL2019 31JU2019 Backed out Thank you Update: Include additional data variables for clarity. I want to be able to choose which occurence to keep if there are multiple occurences. In the above example, I chose to keep the record that has the reason as "Continuous Enrollment". Hope this helps in helping me
... View more