cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
hogi
Level XI

get main data table()

For linked data tables (either summary tables or linked subsets),  CTRL + ALT + D  or a click on 

hogi_0-1721487935404.png

will take me to the "main" table 

This is very convenient. Great that JMP is willing to share this knowledge.
To make the most of it:

Is there a JSL function to get the main table?

 

As of JMP18, there is a new function called is linked subset() that can be used to check if a data table is a linked subset.
https://community.jmp.com/t5/Discussions/How-to-know-if-a-table-is-a-linked-subset/m-p/619442/highli... 

Due to the fact that this function is brand new, I am afraid that the answer to the posted question is:

No ...

Application Case:
Just imagine how often you generate a report from a summary table - and then face the difficulty how to save the script.
Actually, it's just a combination of 

a) the source script for the summary table

b) the source script of the report
but it requires ~ 20 mouse clicks to save the combined script to the main table.

If there is a way to get the main table - all this could be triggered by a single click on a toolbar. cool!

2 REPLIES 2
jthi
Super User

Re: get main data table()

If you are scripting you should know the references, there is also << Get Data Table() for reports.

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y), Smoother(X, Y))
);

dt_ref = gb << get data table();

If you wish to have the script in the original data table, you would use Save Script to Source Table

jthi_0-1721490087159.png

 

-Jarmo
hogi
Level XI

Re: get main data table()

Hm,
unfortunately, << get data table() just seem to work for reports (like you say) , but not for linked summary tables and subsets (what I need) :

same mouse click on the GUI , but JSL is not 1:1:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtsummary = dt << Summary(Group( :height ));
dtsub = dt<< Subset( All rows, Selected columns only( 0 ) );

maintable = dtsummary << get data table(); // doesn't work
maintable = dtsub << get data table(); // doesn't work


so: no?