cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles