Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Qbo
Contributor III
Contributor III

IntervalMatch function issues with date range and additional field

Having issues with IntervalMatch() function. Just want to tie two tables together by a common ID and date range. Have tried it various different ways and just can't seem to get the solution. Any help would be greatly appreciated. Here is where I've gotten to:

 

A:
LOAD Distinct
	 booking_id, 
     id, 
     TDate, 		//floored date field 
     level
FROM
[..\QVDs\A.qvd]
(qvd);

B:
LOAD Distinct
	 id,
	 cBooking, 
     cdate as Start, 	//floored date field
     NEXT_cdate as End 	//floored date field
FROM
[..\QVDs\B.qvd]
(qvd);

INNER JOIN
IntervalMatch(TDate,id) 
LOAD Distinct 
	 Start,
	 End,
	 id
Resident B;

 

Have tried to anonymize it as much as possible so hopefully it is still clear for you guys. Basically I want to join the two tables on the id and Start/End dates so I can get the average level for that id within that range if that makes sense. Be gentle with me if I have posted in the wrong section or if you feel this has been beaten to death as I have looked over numerous posts and cannot get this to work for me.

This last solution I have arrived at is pulled directly from Qlik and is basically copied verbatim: From Here 

Thanks in advance

Labels (1)
1 Reply
Qbo
Contributor III
Contributor III
Author

Have resolved the issue, dates were back to front to on the End range sort and match wasn't working.