<?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 a list of Tables and add a &amp;quot;Source Column&amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320650#M57120</link>
    <description>&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt; - Yes, I had the "names" not the objects. Thank you very much for taking the time to help me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Alfredo</description>
    <pubDate>Tue, 13 Oct 2020 12:44:59 GMT</pubDate>
    <dc:creator>ALopez</dc:creator>
    <dc:date>2020-10-13T12:44:59Z</dc:date>
    <item>
      <title>Concatenate a list of Tables and add a "Source Column"</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320507#M57105</link>
      <description>&lt;P&gt;I Have a list of open tables (names) that I want to concatenate and add a new “Source Column” that can be retrieved from the same list of table names. I have tried all the previous “solutions: published on this Discussion board without luck (only partial luck)&lt;/P&gt;&lt;P&gt;I can get my concatenated tables following a solution published by TXNelson, but I cannot seem to be able to get the “Source Column” to work.&amp;nbsp; I will appreciate any help solving this one.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables = {"R1", "R2", "R3"};
TablesN ={};
For(k = 1, k &amp;lt;= n Rows ( Data Table(tables[i] )),k++, 
Insert Into(TablesN, Data Table (tables [i] ) &amp;lt;&amp;lt; get name));&lt;BR /&gt;
// the concatenation works like a charm
Data Table = New Table ("RST");
For( i = 1, i &amp;lt;= N Items( tables ), i++,
	 Data Table( "RST" ) &amp;lt;&amp;lt; Concatenate(
		Data Table( tables[i] ),
		append to first table(1)
	);
	//Close( Data Table( tables[i] ), No Save );
);
// this part fails&lt;BR /&gt;
 data table( "RST" ) &amp;lt;&amp;lt; add multiple columns("Source Table", 1, before first, character );
:Source Table &amp;lt;&amp;lt; set values( TablesN );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:40:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320507#M57105</guid>
      <dc:creator>ALopez</dc:creator>
      <dc:date>2023-06-09T23:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate a list of Tables and add a "Source Column"</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320546#M57108</link>
      <description>&lt;P&gt;The last part should work if the list has any values. Check out the first for loop; it uses &lt;EM&gt;k&lt;/EM&gt; as iterator but inside the loop&amp;nbsp;&lt;I&gt;i,&lt;/I&gt;&amp;nbsp;not defined, is used as list index.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A source column can also be created automatically with&amp;nbsp;&lt;EM&gt;Concatenate() as in the example below&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Create a list of data tables
names = {"R1", "R2", "R3"};
tables = {};
For( i = 1, i &amp;lt;= N Items( names ), i++,
	Insert Into( tables, Data Table( names[i] ) )
);


// Concat all and create a source column in one step
dt = New Table( "RST" );
dt &amp;lt;&amp;lt; concatenate( tables, append to first table( 1 ), create source column( 1 ) );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 00:43:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320546#M57108</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2020-10-13T00:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate a list of Tables and add a "Source Column"</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320645#M57117</link>
      <description>&lt;P&gt;Hi MS,&lt;/P&gt;&lt;P&gt;I tested your code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "RST" );
dt &amp;lt;&amp;lt; concatenate( tables, append to first table( 1 ), create source column( 1 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and it creates a pop up window that would allow me to select the tables to concatenate, which defeats the purpose of creating a script to automate the process.&amp;nbsp; It does not iterate through the "tables" list.&amp;nbsp; I am using JMP 15 .&lt;BR /&gt;Just FYI, this is the post that I have been using to guide me. Thanks.&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275804" target="_blank"&gt;https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275804&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 12:08:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320645#M57117</guid>
      <dc:creator>ALopez</dc:creator>
      <dc:date>2020-10-13T12:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate a list of Tables and add a "Source Column"</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320648#M57119</link>
      <description>&lt;P&gt;The list &lt;EM&gt;tables&lt;/EM&gt;&amp;nbsp;must contain data table objects (first part of my code illustrate one way do create such a list) and all tables must still be open when the code is run. Otherwise you'll get the pop-ip window.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After the code is run, you can close all (saved) data tables in the list in one step with&amp;nbsp;&lt;EM&gt;tables &amp;lt;&amp;lt; close window;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 12:32:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320648#M57119</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2020-10-13T12:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate a list of Tables and add a "Source Column"</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320650#M57120</link>
      <description>&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt; - Yes, I had the "names" not the objects. Thank you very much for taking the time to help me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Alfredo</description>
      <pubDate>Tue, 13 Oct 2020 12:44:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-a-list-of-Tables-and-add-a-quot-Source-Column-quot/m-p/320650#M57120</guid>
      <dc:creator>ALopez</dc:creator>
      <dc:date>2020-10-13T12:44:59Z</dc:date>
    </item>
  </channel>
</rss>

