Hey all,
I've got a bunch of policy data that has issue date and termination date (which may or may not be null). I'm trying to figure out how to split each record based on its "policy anniversary."
For example, let's say a policy has an issue date of 10/10/2007 and termination date 12/10/2009. I want to create separate records for each of these date ranges:
- From 10/10/2007 issue date though 12/31/2007.
- From 1/1/2008 through 10/9/2008.
- From 10/10/2008 through 12/31/2008.
- From 1/1/2009 through 10/9/2009.
- From 10/10/2009 through 12/10/2009 (the termination date).
Using DummyID 4 in my sample data as another example, my desired output is as follows:
| DummyID | Policy_Start_Date | Policy_End_Date |
| 4 | 1954-09-20 | 1954-12-31 |
| 4 | 1955-01-01 | 1955-09-19 |
| 4 | 1955-09-20 | 1955-12-31 |
| 4 | 1956-01-01 | 1956-09-19 |
| | . | |
| | . | |
| | . | |
| 4 | 2019-09-20 | 2019-09-24 |
Does anyone know how this can be done?