Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Doubt in Interval Match

Hi

I have some queries regarding the Interval Match function. I want to know what will be the bahaviour of interval match function if the data is as shown below. I am using the code which is given below and all those rows which is having data as shown below are not getting displayed. So would like to know about the behaviour of this interval match function.

Example data:

StartDate: 31/03/2011 15:07:00

EndDate: 31/03/2011 15:07:00


IntervalMatch(date)
LOAD ImplStart, ImplEnd RESIDENT Data;


1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

If you mean what happens when the start and end date for the range are the same, if there is one record with the same date, will match in the range. Check the following script:

Facts:
LOAD * INLINE [
Code, Date 
AAA, 01/01/2011 1:20:00
BBB, 01/01/2011 1:21:00
CCC, 01/01/2011 1:22:00
]; 

Intervals:
LOAD * INLINE [
Start, End, Name
01/01/2011 1:20:00, 01/01/2011 1:20:00, A
01/01/2011 1:21:00, 01/01/2011 1:21:00, B
]; 

FactsWithIntervals:
INTERVALMATCH (Date) 
LOAD Start, End
RESIDENT Intervals
;
JOIN LOAD * 
RESIDENT Intervals; 

DROP TABLE Intervals; 

OnlyOneRecordPerInterval:
RIGHT KEEP 
LOAD Code, Date
RESIDENT Facts;

JOIN LOAD *
RESIDENT FactsWithIntervals; 

DROP TABLE Facts;
DROP TABLE FactsWithIntervals;

Hope that helps.

View solution in original post

2 Replies
Not applicable
Author

Hi,

If I have such a problem I would use also the date funtction.

In this case you know for sure that it wil be the right date.

So something like

IntervalMatch(DATE(date))

I hope this helps.

If not please upload an example.

Kind regards,

Martijn

Miguel_Angel_Baeyens

Hello,

If you mean what happens when the start and end date for the range are the same, if there is one record with the same date, will match in the range. Check the following script:

Facts:
LOAD * INLINE [
Code, Date 
AAA, 01/01/2011 1:20:00
BBB, 01/01/2011 1:21:00
CCC, 01/01/2011 1:22:00
]; 

Intervals:
LOAD * INLINE [
Start, End, Name
01/01/2011 1:20:00, 01/01/2011 1:20:00, A
01/01/2011 1:21:00, 01/01/2011 1:21:00, B
]; 

FactsWithIntervals:
INTERVALMATCH (Date) 
LOAD Start, End
RESIDENT Intervals
;
JOIN LOAD * 
RESIDENT Intervals; 

DROP TABLE Intervals; 

OnlyOneRecordPerInterval:
RIGHT KEEP 
LOAD Code, Date
RESIDENT Facts;

JOIN LOAD *
RESIDENT FactsWithIntervals; 

DROP TABLE Facts;
DROP TABLE FactsWithIntervals;

Hope that helps.