<?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: concatenate data tables on the go in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44542#M25539</link>
    <description>Thank you Uday. I think I get an idea of how to do it. But what I have is, I run the loop and it creates a new data table every time it completes. I don't have a control on the count or choice of the file, because it is created automatically. I could have 2, or 5, or 9 data tables at the end of the loop opened. I wanted to concatenate all into one table.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I hope I didn't over-complicate it. Let me know your thoughts. I will see how I can modify your script. Thank you so much.</description>
    <pubDate>Thu, 14 Sep 2017 23:01:52 GMT</pubDate>
    <dc:creator>vishwasanj</dc:creator>
    <dc:date>2017-09-14T23:01:52Z</dc:date>
    <item>
      <title>concatenate data tables on the go</title>
      <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44539#M25536</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may be starighfroward but I am not able to get the right JSL commands.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate if anyone could help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a FOR loop and every time I run it, I open a data table.&lt;/P&gt;&lt;P&gt;I want to concatenate all data tables together and save it as FINAL TABLE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 21:43:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44539#M25536</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-14T21:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate data tables on the go</title>
      <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44540#M25537</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7511"&gt;@vishwasanj&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Hello . I think this can be done through the following piece of code .&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

n = 5 ; // Random # of iterations 

for (i = 1 , i &amp;lt;= n , i++, 
	  RowsToSelect = Random Index(40,5);
	  dt &amp;lt;&amp;lt; Select Rows(RowsToSelect); 
	  dt1 = dt &amp;lt;&amp;lt; Subset("");  
	  
	  If(i == 1,
			dt_Results = dt1 ; 
			, 
			dt_Results &amp;lt;&amp;lt; Concatenate(dt1,"Append To First Table");
			Close(dt1,"No Save");
	    );
	  
    );&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Sep 2017 22:34:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44540#M25537</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-09-14T22:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate data tables on the go</title>
      <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44541#M25538</link>
      <description>&lt;P&gt;Just to explain what is going on here :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;- Once you open the loop - we are randomly choosing which rows to select to generate a sample set - here&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;RowsToSelect = Random Index(40,5);&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Rows(RowsToSelect); 
dt1 = dt &amp;lt;&amp;lt; Subset("");  &lt;/PRE&gt;&lt;P&gt;- At i = 1 , you are initializing the format of the output data table that defines your results&amp;nbsp;&lt;/P&gt;&lt;P&gt;- When i != 1 , you are concatenating data from the newly formed table back to the template file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&amp;nbsp;&lt;/P&gt;&lt;P&gt;uday&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 22:48:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44541#M25538</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-09-14T22:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate data tables on the go</title>
      <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44542#M25539</link>
      <description>Thank you Uday. I think I get an idea of how to do it. But what I have is, I run the loop and it creates a new data table every time it completes. I don't have a control on the count or choice of the file, because it is created automatically. I could have 2, or 5, or 9 data tables at the end of the loop opened. I wanted to concatenate all into one table.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I hope I didn't over-complicate it. Let me know your thoughts. I will see how I can modify your script. Thank you so much.</description>
      <pubDate>Thu, 14 Sep 2017 23:01:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44542#M25539</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-14T23:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate data tables on the go</title>
      <link>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44562#M25540</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7511"&gt;@vishwasanj&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Please use the following code to fix your problem .&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

n = 5 ; // Random # of iterations 

for (i = 1 , i &amp;lt;= n , i++, 
	  RowsToSelect = Random Index(40,5);
	  dt &amp;lt;&amp;lt; Select Rows(RowsToSelect); 
	  dt &amp;lt;&amp;lt; Subset("");  
    );
   
  
// In your case data is coming from a file 
// So I am closing out the source table here that I opened for the purpose of demonstration 
Close(dt,"No Save"); 
    
// Make a list of all open Data tables 
openDTs = List();
For( i = 1, i &amp;lt;= N Table(), i++,
	Insert Into( openDTs, Data Table( i ) );
   );
// Concatenate
for(i = 1 ,i &amp;lt;= N Table(), i++,
		dt_Results = openDTs[i];
		//Close(openDTs[i]);
		, 
		dt_Results &amp;lt;&amp;lt; Concatenate(openDTs[i],"Append To First Table");
		Close(openDTs[i]);
   ); 
dt_Results &amp;lt;&amp;lt; Set Name("Results");&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Sep 2017 23:49:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/concatenate-data-tables-on-the-go/m-p/44562#M25540</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-09-14T23:49:50Z</dc:date>
    </item>
  </channel>
</rss>

