Hello, I am trying to take a date and generate new rows that bring that date 2 days backward and 2 days forward and I'm having a tough time figuring out how to get it all to appear in one column. Any ideas?
Example of what I want to do:
Existing Data:
| Record ID | Date |
| 1 | 7/1/2017 |
| 2 | 6/4/2017 |
Turned into:
| Record ID | Date |
| 1 | 7/1/2017 |
| 1 | 6/30/2017 |
| 1 | 6/29/2017 |
| 1 | 7/2/2017 |
| 1 | 7/3/2017 |
| 2 | 6/4/2017 |
| 2 | 6/3/2017 |
| 2 | 6/2/2017 |
| 2 | 6/5/2017 |
| 2 | 6/6/2017 |
Gelöst! Gehe zu Lösung.
Part of the solution might just be in the first word of your title! The Generate Rows tool should do the trick.
1.Convert your Date column to DateTime format (yyyy-mm-dd) using either the DateTime tool or a formula.
2. Calculate the Start Date using a formula tool: DateTimeAdd([Date],-2,"days")
3. Use the Generate Rows tool to add a new row for every date between the start date and the end date (which will be the original date + 2 days, again using a DateTimeAdd formula)
See attached for an example workflow, and let me know if this accomplishes what you were trying to achieve!
Cheers,
NJ
Thanks for your response!