cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Kevin
Level I

How to join tables with time interval

Hello,

I am working to join two tables, table 1 has time stamped data, and table 2 has start time and end time of each phase and cycle. I would like to join two tables so that table 1 can have phase and cycle columns.

 

Appreciate if anyone can show me how.

 

Thanks

1 REPLY 1
jthi
Super User

Re: How to join tables with time interval

I would most likely try using SQL query with JMP tables. You can do this with Query()

Names Default To Here(1);

dt1 = Open("$DOWNLOADS/table1.jmp", Invisible);
dt2 = Open("$DOWNLOADS/table2.jmp", Invisible);

dt3 = Query(
	Table(dt1, "t1"),
	Table(dt2, "t2"), 
	"\[SELECT *
       FROM t1
       left join t2 on t1.'Time' >= t2.'Start Time' and t1.'Time' <= t2.'End Time'
      ]\"
);
-Jarmo