<?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 output tables from a Loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Concatenate-output-tables-from-a-Loop/m-p/50616#M28770</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3695"&gt;@switzal87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following will concatenate the last 5 tables opened:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table(N Table()) &amp;lt;&amp;lt; Concatenate(
	Data Table( N Table()-1 ),
	Data Table( N Table()-2 ),
	Data Table( N Table()-3 ),
	Data Table( N Table()-4 ),
	Create source column
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works because Data Table(number) refers to a specific table, N Table() returns the number of data tables open in JMP, data tables are numbered based on when they are opened, thus Data Table(N Table()) returns the last table, and subtracting k from N Table() returns the table opened k tables ago. You could generalize this by writing a loop to generate the&amp;nbsp;&lt;SPAN&gt;concatenation&lt;/SPAN&gt;&amp;nbsp;code, but if you're always pulling 5 tables this is a pretty easy way to combine them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: Here is a generalized version for any number of tables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tableList={};

for(k=1,k&amp;lt;=4,k++,InsertInto(tableList,Data Table( N Table()-k )));

Data Table(N Table()) &amp;lt;&amp;lt; Concatenate(tableList,Create source column);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Feb 2018 14:40:31 GMT</pubDate>
    <dc:creator>jules</dc:creator>
    <dc:date>2018-02-02T14:40:31Z</dc:date>
    <item>
      <title>Concatenate output tables from a Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-output-tables-from-a-Loop/m-p/50610#M28767</link>
      <description>&lt;P&gt;Hello JMP community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had these 5 tables coming from a loop. Below is the screenshot of the script (Assuming its working fine)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Loop.JPG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9165iA435E2345B753B29/image-size/large?v=v2&amp;amp;px=999" role="button" title="Loop.JPG" alt="Loop.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How should I write a script that concatenates all the output table of the loop?!&lt;/P&gt;&lt;P&gt;Appreciate all inputs from this community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:13:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-output-tables-from-a-Loop/m-p/50610#M28767</guid>
      <dc:creator>switzal87</dc:creator>
      <dc:date>2023-06-10T23:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate output tables from a Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-output-tables-from-a-Loop/m-p/50616#M28770</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3695"&gt;@switzal87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following will concatenate the last 5 tables opened:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table(N Table()) &amp;lt;&amp;lt; Concatenate(
	Data Table( N Table()-1 ),
	Data Table( N Table()-2 ),
	Data Table( N Table()-3 ),
	Data Table( N Table()-4 ),
	Create source column
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works because Data Table(number) refers to a specific table, N Table() returns the number of data tables open in JMP, data tables are numbered based on when they are opened, thus Data Table(N Table()) returns the last table, and subtracting k from N Table() returns the table opened k tables ago. You could generalize this by writing a loop to generate the&amp;nbsp;&lt;SPAN&gt;concatenation&lt;/SPAN&gt;&amp;nbsp;code, but if you're always pulling 5 tables this is a pretty easy way to combine them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: Here is a generalized version for any number of tables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tableList={};

for(k=1,k&amp;lt;=4,k++,InsertInto(tableList,Data Table( N Table()-k )));

Data Table(N Table()) &amp;lt;&amp;lt; Concatenate(tableList,Create source column);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 14:40:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-output-tables-from-a-Loop/m-p/50616#M28770</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2018-02-02T14:40:31Z</dc:date>
    </item>
  </channel>
</rss>

