Highlighted
FN
FN
Level V

Virtual linking two tables via JSL scripting

I have one a table opened by the user.

 

After some python code I generate another table that ends:

  • having a subset of columns (keeping same column names)
  • sharing its time index (few rows might have been removed).

How can link these two tables via JSL?

 

The functionality I am after is to have something equivalent as if I did a subset in JMP.

 
// Start of script;
Names Default To Here( 1 );
Clear Log();

dt = Open( "$SAMPLE_DATA/Bands Data.JMP" );

dt  << Subset(
	Linked,
	Suppress formula evaluation( 0 ),
	Sampling Rate( 0.9 ),
	columns( :timestamp, :proof cut, :viscosity, :caliper, :ink temperature )
)

 

 

 

 

6 REPLIES 6
Highlighted
Craige_Hales
Staff (Retired)

Re: Virtual linking two tables via JSL scripting

The scripting index has three examples under Virtual Join.

Virtual Join in the Scripting Intex. Notice the Example 1 button is a pull down menu with other examples.Virtual Join in the Scripting Intex. Notice the Example 1 button is a pull down menu with other examples.

There's an example of virtual join in Reverse Geocode Lat-Lon to Zip . It saves the tables to disk before using

	zipcodeNS:dtdbf:shape << Set Property( "Link ID", 1 );
	zipcodeNS:dtshp:shape << Set Property( "Link Reference", Reference Table( zipcodeNS:dtdbf ) );

to link them by the shape property.

 

Craige
Highlighted
FN
FN
Level V

Re: Virtual linking two tables via JSL scripting

Does virtual join create the interactive linking when selecting rows or columns?

 

In the examples I ran this did not happen.

Highlighted
Craige_Hales
Staff (Retired)

Re: Virtual linking two tables via JSL scripting

No, the tables are not linked like a "linked subset". (edit: see @bernd_heinen answer) But they are linked like a join; if you run that first example and change a color name in the table of colors, the change is immediately reflected in the table of people. @chungwei 

Craige
Highlighted
Craige_Hales
Staff (Retired)

Re: Virtual linking two tables via JSL scripting

It is also possible I'm not answering the question you really asked. Perhaps an expert on the Tables menu will take another look.

Craige
Highlighted

Re: Virtual linking two tables via JSL scripting

I understand that the subsetting is just an example. If tables are virtually joined row states can be syncronized between them. In the "parent" table there is the column with the linke reference (the blue keys). When you open that column's properties and look for the "link reference" property, you'll find options there.

LinkRef.PNG

Here, you can determine which table shall be driving the row states. All settings can be set by JSL like

Column( "Unique Subject Identifier" ) << Set Property(
	"Link Reference",
	{Reference Table( "Nic Demographics.jmp" ), Options(
		"Use Linked Column Name"(1),
		Row States Synchronization with Referenced Table( Accept( 1 ), Row States( Select, Exclude, Hide ) )
	)}
)

The one thing, that is not possible, is to transfer selections, no matter if they are made in the parent or the child table.

Highlighted
Craige_Hales
Staff (Retired)

Re: Virtual linking two tables via JSL scripting

Cool! had not seen that before.

Craige
Article Labels