Hi, I need help on creating a consecutive days value based on memberid, fill_date and days_supply_cnt variables for a pharmacy claims SAS dataset. I'm trying to find out the consecutive streak of a drug use for each member for the last six months. For example a 30 days drug supply on Jan 1st would give a member with memberid 12345 a value of 30 days. If on Jan 15th, the same member gets another prescription for a 10 days, the value would still be 30 days. But if another member gets one prescription on Jan 1st for 30 days and another prescription on Jan 25th for 10 days the days streak would now be at 35 days. If there was a gap of more than 2 days between prescriptions a new set of days would be created based on above algorithm. Please Note: This data is already limited to specific drug for our analysis, See example below MemberId . Fill_date Days_supply_cnt 12345 01/01/2017 30 12345 01/15/2017 10 12345 02/10/2017 60 23456 01/01/2017 30 23456 . 01/25/2017 10 23456 04/01/2017 90 Desired OutPut MemberId . Consec_days 12345 30 12345 60 23456 35 23456 90 I would appreciate any help on this. Thanks Zahid Khan
... View more