Hi, I have the following dataset, ID Admission Start_Year End_Year 1 1 10/11 11/12 1 2 10/11 12/13 1 3 12/13 15/16 2 1 10/11 11/12 2 2 10/11 12/13 2 3 10/11 15/16 3 1 10/11 12/13 3 2 14/15 15/16 All admissions have a start date and end date in fiscal years (i.e. from April 01st to March 31st). All admissions start in one fiscal year and end in another fiscal year. I want to include the most encompassing admissions for each individual i.e. the admissions with the most N fiscal years. I also want to include admissions to ensure there is representation from each fiscal year for each individual, even though they may not be the most encompassing admissions. For example, in the case of ID 3, the most encompassing admission is admission 1. As such, it should be included. However, I also want to include admission 2 because it includes fiscal years 14/15 and 15/16, which are not represented by admission 1. The desired output should be as follows, ID Admission Start_Year End_Year Include 1 1 10/11 11/12 0 1 2 10/11 12/13 1 1 3 12/13 15/16 1 2 1 10/11 11/12 0 2 2 10/11 12/13 0 2 3 10/11 15/16 1 3 1 10/11 12/13 1 3 2 14/15 15/16 1 Any help would be much appreciated. Thank you!
... View more