cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Abby_Collins14
Level III

How to reference already open data table (from multiple open data tables) JSL

I am working on writing scripts that create different reports and data tables. However, I always have to end up running them chunk wise and manually clicking on the drop down menu to select the data table I want to run the given chunk of script on. 

I am familiar with the current data table() function, but not really anything else that doesn't require a file path. 

 

Does anyone know any easy way to reference or select a different already open data table, perhaps by name or something?

 

Thanks!

1 REPLY 1
txnelson
Super User

Re: How to reference already open data table (from multiple open data tables) JSL

Any data table can be referenced by using the Data Table() function.  Such as:

Data Table("Big Class") << Bivariate( X(:height), Y(:weight) );

One can also set a variable equal to a data table when it is created, and if the variable isn't changed in the script, it will always reference the table it was linked to.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << select where( :sex == "F" );

dtFemale = dt << subset( selected columns( 0 ), selected rows( 1 ) );

rpt = New Window( "Subset of big class - Distribution of height, weight",
	dtFemale << Distribution(
		Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
		Continuous Distribution( Column( :weight ), Process Capability( 0 ) )
	)
);
Wait( 0 );
dtStats = rpt["Distributions", "height", "Summary Statistics", Table Box( 1 )] <<
Make Combined Data Table;
rpt << Close Window;

dtStats << Tabulate(
	Change Item Label( Statistics( Sum, "Stats" ) ),
	Remove Column Label( Analysis Columns( Column 2 ) ),
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Analysis Columns( :Column 2 ) ),
		Row Table( Grouping Columns( :Y, :Column 1 ) )
	)
);

Other methods can be used.  If you would provide a sample of the code you are using, additional help may be available.

Jim