I am trying to generate rows in a multi-row-formula kind of logic.
Following the attached data sample, each variable is denoted by a name, x1 to x8 (total of eight variables). Next to it is the dates determining a time-window of availability. These dates are shown pair-wise, which means that no variable has an uneven number of dates associated. The first date of each pair marks the start of availability, while the second date marks the end of availability.
I want to convert it into rows of each time-window of availability for each variable, starting from start date and ending at end date, generating rows of all dates in between, as shown in sample data.
Thank you in advance for your help!
In addition to sample data, a small mock-up of the same:
Data as is:
Variable | Dates |
x1 | 1/30/2019 |
x1 | 2/1/2019 |
x1 | 2/1/2019 |
x1 | 2/3/2019 |
x1 | 2/3/2019 |
x1 | 2/6/2019 |
Data to be:
Variable | All dates |
x1 | 1/30/2019 |
x1 | 1/31/2019 |
x1 | 2/1/2019 |
x1 | 2/2/2019 |
x1 | 2/3/2019 |
x1 | 2/4/2019 |
x1 | 2/5/2019 |
x1 | 2/6/2019 |
Solved! Go to Solution.
Solved!
1) Add record ids
2) Do a multi-row tool, and leverage record IDs + pair-wise logic, in order to number each pair
3) Do a batch-macro that takes each pair, find min and max date, and generate rows for dates in between
4) Take the output of the macro and add a union tool to variable ID and the new dates
User | Count |
---|---|
18 | |
15 | |
13 | |
9 | |
8 |