<?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: Include a script for each subset table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/618049#M81753</link>
    <description>&lt;P&gt;Yes so I have a master data table, and from this I create about 10 different subset tables. And I would like to add the same script to every subset table. Any idea?&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALso, can I rename all the subset table one by one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 07:03:33 GMT</pubDate>
    <dc:creator>LGaspard</dc:creator>
    <dc:date>2023-03-30T07:03:33Z</dc:date>
    <item>
      <title>Include a script for each subset table</title>
      <link>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/616810#M81640</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a lot of subset table to clean up my data, and I would like to apply the same script to each of the subset tables. How can I do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:06:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/616810#M81640</guid>
      <dc:creator>LGaspard</dc:creator>
      <dc:date>2023-06-09T16:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Include a script for each subset table</title>
      <link>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/617554#M81708</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/46492"&gt;@LGaspard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you wanting table scripts copied from the source set to the subset?&amp;nbsp; If so, you can verify this happens by opening a sample dataset, Big Class, for example, and creating a random subset.&amp;nbsp; All of the table subsets are copied to the newly created subset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're wanting a script from a script window to apply to the subsets, make sure you give your subsets a name upon creation . Here's an example.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
bigclass = open( "$SAMPLE_DATA/Big Class.jmp" );

// Subset data table
bigclass &amp;lt;&amp;lt; Row Selection(
	Select where( :Height &amp;gt;= 65 ) );
	dt &amp;lt;&amp;lt; Subset( (Selected Rows), Output Table Name( "Tall_children" ) );

tallchildren = data datable( "Tall_children" );

/* Call on tallchildren to work with the data table (subset) that you just created */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 17:56:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/617554#M81708</guid>
      <dc:creator>StarfruitBob</dc:creator>
      <dc:date>2023-03-28T17:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Include a script for each subset table</title>
      <link>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/618049#M81753</link>
      <description>&lt;P&gt;Yes so I have a master data table, and from this I create about 10 different subset tables. And I would like to add the same script to every subset table. Any idea?&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALso, can I rename all the subset table one by one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 07:03:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/618049#M81753</guid>
      <dc:creator>LGaspard</dc:creator>
      <dc:date>2023-03-30T07:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Include a script for each subset table</title>
      <link>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/618060#M81755</link>
      <description>&lt;P&gt;Here is a simple example using an Expr() to hold the script to be used multiple times&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here( 1 );

// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

summarize( ageList = by( :Age ) );

// Here is the script that will be applied to each data table
theScript = Expr(
	dt &amp;lt;&amp;lt; new column( "Ratio", formula( :height / :weight ) );
	dt &amp;lt;&amp;lt; set name( "The Table Name is Age=" || ageList[i])
);

// Create a data table for each level of Age in the data table.
// The list called dtList will contain a refereence to each individual
// table created
dtList = Data Table( "Big Class" ) &amp;lt;&amp;lt; Subset(
	Output Table( "Untitled 2.jmp" ),
	By( :age ),
	All rows,
	Selected columns only( 0 ),
	columns( :name, :sex, :height, :weight )
);
show( dtList );

For( i = 1, i &amp;lt;= n items( dtList ), i++,
	dt = dtList[i];
	// Run the script
	theScript;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You may also want to look into the "Include()" function.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:07:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Include-a-script-for-each-subset-table/m-p/618060#M81755</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-03-30T09:07:19Z</dc:date>
    </item>
  </channel>
</rss>

