<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to reference already open data table (from multiple open data tables) JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/805068#M98306</link>
    <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2024 12:02:33 GMT</pubDate>
    <dc:creator>BeckettHill</dc:creator>
    <dc:date>2024-10-11T12:02:33Z</dc:date>
    <item>
      <title>How to reference already open data table (from multiple open data tables) JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803318#M98016</link>
      <description>&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am familiar with the current data table() function, but not really anything else that doesn't require a file path.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know any easy way to reference or select a different already open data table, perhaps by name or something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 20:45:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803318#M98016</guid>
      <dc:creator>Abby_Collins14</dc:creator>
      <dc:date>2024-10-02T20:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference already open data table (from multiple open data tables) JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803330#M98017</link>
      <description>&lt;P&gt;Any data table can be referenced by using the Data Table() function.&amp;nbsp; Such as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table("Big Class") &amp;lt;&amp;lt; Bivariate( X(:height), Y(:weight) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt &amp;lt;&amp;lt; select where( :sex == "F" );

dtFemale = dt &amp;lt;&amp;lt; subset( selected columns( 0 ), selected rows( 1 ) );

rpt = New Window( "Subset of big class - Distribution of height, weight",
	dtFemale &amp;lt;&amp;lt; 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 )] &amp;lt;&amp;lt;
Make Combined Data Table;
rpt &amp;lt;&amp;lt; Close Window;

dtStats &amp;lt;&amp;lt; 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 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Other methods can be used.&amp;nbsp; If you would provide a sample of the code you are using, additional help may be available.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 23:11:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803330#M98017</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-02T23:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference already open data table (from multiple open data tables) JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803583#M98058</link>
      <description>&lt;P&gt;If you still wanted to interactively choose which table you run a script on, but wanted it to be a bit more robust, you could do something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// Open a couple of tables for demo purposes
dt1 = open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
wait(0);

table_names = {};
For( i = 1, i &amp;lt;= N Table(), i++,
	Insert Into( table_names, Data Table( i ) &amp;lt;&amp;lt; get name );
);
If( N Items( table_names ) &amp;gt; 0, 
	tabSelect = New Window( "Select Table For Use",
		&amp;lt;&amp;lt;Modal,
		&amp;lt;&amp;lt;Return Result,
		Lineup Box( N Col( 1 ),
			Text Box( "Select table for use for your script" ),
			t1 = Combo Box( table_names ),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
		)
	);
	If( tabSelect["button"] == -1,
		Throw( "Run chart script cancelled." )
	);
,
	Throw( "No data tables found." )
);

dt = Data Table( table_names[tabSelect["t1"]] );

print( "Selected data table: " || char( dt &amp;lt;&amp;lt; get name ) );
// Rest of script here
// Use dt as the reference for the table you want to analyse.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Oct 2024 10:22:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/803583#M98058</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2024-10-04T10:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference already open data table (from multiple open data tables) JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/805068#M98306</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 12:02:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-reference-already-open-data-table-from-multiple-open-data/m-p/805068#M98306</guid>
      <dc:creator>BeckettHill</dc:creator>
      <dc:date>2024-10-11T12:02:33Z</dc:date>
    </item>
  </channel>
</rss>

