cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
ehchandlerjr
Level V

Linked columns and inter-table row selection

Hello - I don't think this exists, but thought I would ask anyway. I have a few different projects where I link columns. I have had a few times where I have thought that it would be super useful to be able to select the row of one of the linked tables, and then the corresponding rows in the other gets highlighted. I have one 50k row table and another 150k row table, and scrolling through can get tedious, as can trying to grab just those points. Of course there are row selection menus, but this takes a long time when you are switching your selection a few dozen times. 

 

Is there a way to do this?

 

Thanks!

Edward Hamer Chandler, Jr.
3 ACCEPTED SOLUTIONS

Accepted Solutions
mmarchandTSI
Level V

Re: Linked columns and inter-table row selection

Event Handler can accomplish what you're describing.  Something like this:

 

mmarchandTSI_0-1701179831673.png

 

For readability/copy/paste:

 

Function( {thisTable, thisColumn, iRow},
{ /* list of local variables, if needed */ },
dt2 << Select Where(:name == thisTable:thisColumn[iRow] )
);

View solution in original post

mmarchandTSI
Level V

Re: Linked columns and inter-table row selection

The Event Handler Column Property performs an action when you click on a row in the column, so this solution would be for only very simple selections, one at a time.  Are you thinking you'd like to select corresponding rows in the linked table every time you select a row or group of rows in the main table?  If so, I'd consider adding a simple table script.

 

sel = :name[Current Data Table() << Get Selected Rows];
dt << Select Where( Contains( sel, :name ) );

If you save that as a table script, you can select the rows you want and then just click the green triangle.  Sure beats scrolling through 100,000 rows!

View solution in original post

hogi
Level XII

Re: Linked columns and inter-table row selection

That's really cool - thanks for asking - thanks for the nice solution

 


@ehchandlerjr wrote:

Kinda seems like an obvious and easily implementable feature for linked data tables. At least to have a checkbox to turn the feature on or off, since it might be annoying sometimes.


For linked data tables, actually, there exists such a one-click checkbox:

sourceTable:linkID << Set Property( "Link ID", 1 );

targetTable:linkID << Set Property(
	"Link Reference",{	Reference Table( sourceTable), Options( Row States Synchronization with Referenced Table( Dispatch( 1 ), Row States( Select ) ))
);

 

View solution in original post

7 REPLIES 7
mmarchandTSI
Level V

Re: Linked columns and inter-table row selection

Event Handler can accomplish what you're describing.  Something like this:

 

mmarchandTSI_0-1701179831673.png

 

For readability/copy/paste:

 

Function( {thisTable, thisColumn, iRow},
{ /* list of local variables, if needed */ },
dt2 << Select Where(:name == thisTable:thisColumn[iRow] )
);
ehchandlerjr
Level V

Re: Linked columns and inter-table row selection

This is awesome! Thank you so much!

 

I did notice that you can only do one row at a time. Is there a way to do an arbitrary selection of rows?

 

Thanks!

Edward Hamer Chandler, Jr.
mmarchandTSI
Level V

Re: Linked columns and inter-table row selection

The Event Handler Column Property performs an action when you click on a row in the column, so this solution would be for only very simple selections, one at a time.  Are you thinking you'd like to select corresponding rows in the linked table every time you select a row or group of rows in the main table?  If so, I'd consider adding a simple table script.

 

sel = :name[Current Data Table() << Get Selected Rows];
dt << Select Where( Contains( sel, :name ) );

If you save that as a table script, you can select the rows you want and then just click the green triangle.  Sure beats scrolling through 100,000 rows!

ehchandlerjr
Level V

Re: Linked columns and inter-table row selection

Dang dude - This is awesome. Extremely helpful. If I could give you two kudos, I would.

 

Kinda seems like an obvious and easily implementable feature for linked data tables. At least to have a checkbox to turn the feature on or off, since it might be annoying sometimes. Hmmmm. I might add this to the feature requests.

 

Thanks again! This really helps, and you've introduced me to Event Handler (and that whole bottom section of column properties I never go to). Super useful!

Edward Hamer Chandler, Jr.
hogi
Level XII

Re: Linked columns and inter-table row selection

That's really cool - thanks for asking - thanks for the nice solution

 


@ehchandlerjr wrote:

Kinda seems like an obvious and easily implementable feature for linked data tables. At least to have a checkbox to turn the feature on or off, since it might be annoying sometimes.


For linked data tables, actually, there exists such a one-click checkbox:

sourceTable:linkID << Set Property( "Link ID", 1 );

targetTable:linkID << Set Property(
	"Link Reference",{	Reference Table( sourceTable), Options( Row States Synchronization with Referenced Table( Dispatch( 1 ), Row States( Select ) ))
);

 

mmarchandTSI
Level V

Re: Linked columns and inter-table row selection

Good information, @hogi.  I never use actual linked tables, so I hadn't thought about digging into the options there.  Good to know!

ehchandlerjr
Level V

Re: Linked columns and inter-table row selection

Wow. I had originally mosied over to the column properties for the Link column and didn't see it, but I'm confused why I never thought to look over at the link reference. Thanks for showing that! This thread now has three completely distinct answers.

Edward Hamer Chandler, Jr.