Hello, I am working with claims data and trying to drop duplicate dates by person in order to identify a single date for a group of claims
I have tried to generate an tag id by date and drop based on 0s but, so far, I am unable to get this to work. Would sure appreciate help with this. Thanks. Jake


I have also tried the following:

sort unique_person_id pert_service_start_dt
capture drop dup
quietly by pert_service_start_dt (unique_person_id): gen dup = cond(_N==1,0,_n)

clear
input long unique_person_id str10 pert_service_start_dt
1 "2013-07-12"
1 "2014-04-28"
1 "2014-10-17"
1 "2014-12-05"
1 "2014-12-22"
1 "2015-02-23"
1 "2015-03-05"
1 "2015-03-10"
1 "2015-04-28"
1 "2015-05-16"
1 "2015-07-19"
1 "2015-09-27"
1 "2015-09-28"
1 "2015-09-28"
1 "2015-12-01"
2 "2013-07-20"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-10-14"
2 "2013-11-03"
2 "2013-11-03"
2 "2013-11-22"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-11-24"
2 "2013-12-11"
2 "2013-12-11"
2 "2013-12-14"
2 "2013-12-14"
2 "2013-12-18"
2 "2013-12-28"
2 "2014-02-07"
2 "2014-03-03"
2 "2014-03-20"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-03-31"
2 "2014-04-06"
2 "2014-04-17"
2 "2014-04-17"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-20"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-04-30"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-01"
2 "2014-05-02"
2 "2014-05-02"
2 "2014-05-02"
2 "2014-07-03"
2 "2014-07-03"
2 "2014-07-03"
2 "2014-07-19"
2 "2014-07-29"
2 "2014-07-30"
2 "2014-07-30"
2 "2014-08-17"
2 "2014-09-14"
2 "2014-09-22"
2 "2014-09-22"
2 "2014-09-22"
2 "2014-09-27"
2 "2014-10-02"
2 "2014-10-02"
2 "2014-10-07"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-21"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-24"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-29"
2 "2014-10-30"
2 "2014-12-05"
2 "2014-12-05"
2 "2014-12-12"
2 "2014-12-12"
2 "2014-12-12"
2 "2014-12-31"
2 "2015-01-26"
2 "2015-01-26"
end
[/CODE]