Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 wood
		
			wood
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hello everybody,
How to easily implement the following scenario in the script editor:
T2. Logic_year needs to be matched from t1,
Matching conditions:
T2. Name = t1.name   and  t2. Date <=t1.end_date and t2. Date >=t1.start_date
t1:
| name | start_date | end_date | logic_year | 
| a | 2011/06/01 | 2011/07/31 | 2011 | 
| a | 2011/8/1 | 2012/3/31 | 2012 | 
| a | 2012/4/1 | 2013/10/31 | 2013 | 
| b | 2011/06/01 | 2011/07/31 | 2022 | 
t2:
| name | DATE | year | logic_year | 
| a | 2011/06/02 | 2008 | 2011 | 
| a | 2011/06/30 | 2008 | 2011 | 
| a | 2011/07/04 | 2008 | 2011 | 
| a | 2011/09/21 | 2008 | 2012 | 
| a | 2011/09/22 | 2008 | 2012 | 
| a | 2012/02/11 | 2008 | 2012 | 
| a | 2012/05/10 | 2008 | 2013 | 
| a | 2013/06/04 | 2008 | 2013 | 
| b | 2011/06/02 | 2008 | 2022 | 
| b | 2011/06/30 | 2008 | 2022 | 
thanks
 GaryGiles
		
			GaryGiles
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You need to use the IntervalMatch() function. After loading the 2 tables add this:
inner Join IntervalMatch (DATE, name, logic_year)
Load start_date, end_date, name, logic_year
Resident t1;
 GaryGiles
		
			GaryGiles
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You need to use the IntervalMatch() function. After loading the 2 tables add this:
inner Join IntervalMatch (DATE, name, logic_year)
Load start_date, end_date, name, logic_year
Resident t1;
 wood
		
			wood
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you very much!
