10-19-2017 10:29 AM
I work on health care claims and right now I have a task to determine if any date ranges for a single patient overlap and I need to count the number of overlapping days for each date range for that patient. Here is the snap shot of the data. Also for the overlapping days I need to calculate the total dosage and also calculate the average dose for those overlapping days. Any help is greatly appreciated.
10-19-2017 10:40 AM
Use the lag() function to retrieve the enddate of the previous observation, and compare that with the filldate of the current obs.