<?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 Reference Subset Data Tables Created from a Loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42028#M24501</link>
    <description>&lt;P&gt;I'm having some issues referencing subset data tables made from a loop. The loop works fine and creates data tables named cond1, cond2, etc, but if I try to reference those newly created tables in later code, the script log says it can't find them. Oddly enough if I run my script peicewise, it works just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(i=1, i&amp;lt;=10, i++,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Original_table &amp;lt;&amp;lt; select where(:Sorting Condition == i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;dti = Original_table &amp;lt;&amp;lt; Subset(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Output table("cond"||char(i)),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Selected Rows( 1 ),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Selected columns only( 0 )&lt;BR /&gt;);&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;datatable("cond"||char(i)) &amp;lt;&amp;lt; new column("random", numeric, continuous, formula(round(Random Uniform(1,150)),0));&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jul 2017 10:52:11 GMT</pubDate>
    <dc:creator>jgrosjean</dc:creator>
    <dc:date>2017-07-15T10:52:11Z</dc:date>
    <item>
      <title>Reference Subset Data Tables Created from a Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42028#M24501</link>
      <description>&lt;P&gt;I'm having some issues referencing subset data tables made from a loop. The loop works fine and creates data tables named cond1, cond2, etc, but if I try to reference those newly created tables in later code, the script log says it can't find them. Oddly enough if I run my script peicewise, it works just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(i=1, i&amp;lt;=10, i++,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Original_table &amp;lt;&amp;lt; select where(:Sorting Condition == i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;dti = Original_table &amp;lt;&amp;lt; Subset(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Output table("cond"||char(i)),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Selected Rows( 1 ),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Selected columns only( 0 )&lt;BR /&gt;);&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;datatable("cond"||char(i)) &amp;lt;&amp;lt; new column("random", numeric, continuous, formula(round(Random Uniform(1,150)),0));&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 10:52:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42028#M24501</guid>
      <dc:creator>jgrosjean</dc:creator>
      <dc:date>2017-07-15T10:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reference Subset Data Tables Created from a Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42032#M24504</link>
      <description>&lt;P&gt;It might be simpler to insert the new data table reference dt into a list and then you can subscript or stream over the list when you need to work with a particular data table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;open tables = List();

For( i = 1, i &amp;lt;= 10, i++,
	Original_table &amp;lt;&amp;lt; select where( :Sorting Condition == i );
	dti = Original_table &amp;lt;&amp;lt; Subset(
		Output table( "cond" || Char( i ) ),
		Selected Rows( 1 ),
		Selected columns only( 0 )
	);
	Insert Into( open tables, dti );
);

open tables[i] &amp;lt;&amp;lt; New Column( "random",
	numeric,
	continuous,
	formula( Round( Random Uniform( 1, 150 ) ), 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Jul 2017 11:13:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42032#M24504</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-07-15T11:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reference Subset Data Tables Created from a Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42035#M24507</link>
      <description>&lt;P&gt;That works great! Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 12:32:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reference-Subset-Data-Tables-Created-from-a-Loop/m-p/42035#M24507</guid>
      <dc:creator>jgrosjean</dc:creator>
      <dc:date>2017-07-15T12:32:55Z</dc:date>
    </item>
  </channel>
</rss>

