Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
k_burata
Creator
Creator

Interval Match on 2 date ranges in a table

Hi,

I have this table below:

    Capture.PNG

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

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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 ...;

View solution in original post

1 Reply
swuehl
MVP
MVP

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 ...;