Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this table below:
How do you do interval match to a calendar on the 2 date ranges (PStart/PEnd and EmpStart/EmpEnd) located on 1 table?
So when I select date Mar 2016 I should get Emp 1.
Thanks
Do you want to filter the records where your select point in time is part of both intervals? Then maybe create the intersection of both intervals and use INTERVALMATCH against this new interval (Start and End) only:
LOAD
Position, PStart, PEnd, Emp, EmpStart, EmpEnd,
RangeMax(EmpStart, PStart) as Start,
RangeMin(EmpEnd, PEnd) as End
FROM ...;
Do you want to filter the records where your select point in time is part of both intervals? Then maybe create the intersection of both intervals and use INTERVALMATCH against this new interval (Start and End) only:
LOAD
Position, PStart, PEnd, Emp, EmpStart, EmpEnd,
RangeMax(EmpStart, PStart) as Start,
RangeMin(EmpEnd, PEnd) as End
FROM ...;