Hello all, I have a table that I need to pad with missing ranges following a small, specific rule set.
Lets say I have the following table (in the attached spreadsheet):
I would like to result in this table, which has new rows inserted with start and end values whos ranges were not represented in the initial table. These new rows have been flagged as "free" (also in the attached spreadsheet):
The knowns and the rules are as follows:
- The quantity of groups is not known
- The quantity of subgroups is known, in this case 1,2,3
- The allowed range is known for each subgroup, in this case 0-10, 10-20, 20-30
- As a rule, ranges should not cross subgroup boundaries (see row 9 in output table)
- All values from 0 to 30 should be represented in each group
To simplify the example, the ranges overlap. The real data type has decimal precision, which would result in the following ranges:
0 <= SUBGROUP1 < 10
10 <= SUBGROUP2 <20
20 <= SUBGROUP3 <=30
Thank you in advance for the help.