I try to find in Dundas how I could manage the following scenario:
I have:
- a Table A of holidays with start/end
- a Table B of staff with their holidays
- I would like to generate a Table C, which tells for each staff in which ‘holidays period’ their holidays are. For that, the ‘staff holidays’ should be included within the ‘holidays period’.
ie:staff_holiday_start_date >= holiday_period_start_date AND staff_holiday_end_date <= holiday_period_end_date
Table A: Holidays
holidays period | start_date | end_date |
---|---|---|
spring holidays | 2022-03-01 | 2022-03-30 |
summer holidays | 2022-07-01 | 2022-07-30 |
winter holidays | 2022-12-01 | 2022-12-30 |
Table B: Staff holidays
staff | start_date | end_date |
---|---|---|
alice | 2022-12-03 | 2022-12-05 |
bob | 2022-11-10 | 2022-12-13 |
john | 2022-03-20 | 2022-03-25 |
Table C: Resultant table
staff | holidays |
---|---|
alice | winter holidays |
john | spring holidays |
Bob doesn’t show, because his holidays are not included fully in one of the holidays
of the Table A.
I haven’t found what is the way to achieve that in Dundas datacubes.