<?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 Add Column Data from One Table to Already Existing Table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39888#M23352</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add column data from one output table (called "output") to an EXISTING TABLE (called "Stanmore and Lam"), but when I use the join command it creates an empty new output table. My code is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;output = New Table( "Output",
	AddRows( 1 ),
	New Column( "Y (coronal) mm", Numeric, Continuous ),
	New Column( "X (sagittal) mm", Numeric, Continuous )
);
:"Y (coronal) mm" &amp;lt;&amp;lt; addRows( 1 );
:"X (sagittal) mm" &amp;lt;&amp;lt; addRows( 1 );
:"Y (coronal) mm"[1] = ymax;
:"X (sagittal) mm"[1] = xmax;
dt2 = Open( "Stanmore and Lam.jmp" );
dt2 &amp;lt;&amp;lt; Join(
	With( Data Table( output ) ),
	By Matching Columns( :"Y (coronal) mm" = :"Y (coronal) mm", :"X (sagittal) mm" = :"X (sagittal) mm" )
);


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there any way to simply add row values in a specific column to a pre-existing column (both tables have different numbers of columns and rows) without manually entering the data from one table to another? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noah&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2017 14:03:52 GMT</pubDate>
    <dc:creator>nqj</dc:creator>
    <dc:date>2017-06-02T14:03:52Z</dc:date>
    <item>
      <title>Add Column Data from One Table to Already Existing Table</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39888#M23352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add column data from one output table (called "output") to an EXISTING TABLE (called "Stanmore and Lam"), but when I use the join command it creates an empty new output table. My code is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;output = New Table( "Output",
	AddRows( 1 ),
	New Column( "Y (coronal) mm", Numeric, Continuous ),
	New Column( "X (sagittal) mm", Numeric, Continuous )
);
:"Y (coronal) mm" &amp;lt;&amp;lt; addRows( 1 );
:"X (sagittal) mm" &amp;lt;&amp;lt; addRows( 1 );
:"Y (coronal) mm"[1] = ymax;
:"X (sagittal) mm"[1] = xmax;
dt2 = Open( "Stanmore and Lam.jmp" );
dt2 &amp;lt;&amp;lt; Join(
	With( Data Table( output ) ),
	By Matching Columns( :"Y (coronal) mm" = :"Y (coronal) mm", :"X (sagittal) mm" = :"X (sagittal) mm" )
);


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there any way to simply add row values in a specific column to a pre-existing column (both tables have different numbers of columns and rows) without manually entering the data from one table to another? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noah&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 14:03:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39888#M23352</guid>
      <dc:creator>nqj</dc:creator>
      <dc:date>2017-06-02T14:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add Column Data from One Table to Already Existing Table</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39892#M23356</link>
      <description>&lt;P&gt;Here is a rework of your script, to make it syntactially proper. &amp;nbsp;I can not speak to your logic, since you did not include what your variables xmax and ymax are, nor what the data table "Stanmore and Lam" contains&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;output = New Table( "Output",
	AddRows( 1 ),
	New Column( "Y (coronal) mm", Numeric, Continuous ),
	New Column( "X (sagittal) mm", Numeric, Continuous )
);
// You don't add rows to columns, you add rows to data tables.  But since you have allready added
// a row to the new data table, you don't need to add a second row
//:"Y (coronal) mm" &amp;lt;&amp;lt; addRows( 1 );
//:"X (sagittal) mm" &amp;lt;&amp;lt; addRows( 1 );

// The proper form for what you are trying to do is:
//   :Name("complex name")
//:"Y (coronal) mm"[1] = ymax;
//:"X (sagittal) mm"[1] = xmax;
:Name("Y (coronal) mm")[1] = ymax;
:Name("X (sagittal) mm")[1] = xmax;

dt2 = Open( "Stanmore and Lam.jmp" );
dt2 &amp;lt;&amp;lt; Join(
	With( Data Table( output ) ),
	// You may want to use the "UPDATE" option to copy the matching rows from the joining table to the
	// initial table
	// Update,
	
	// The proper naming structure has been replaced here too
	By Matching Columns( :Name("Y (coronal) mm") = :Name("Y (coronal) mm") , :Name("X (sagittal) mm") = :Name("X (sagittal) mm") )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jun 2017 15:17:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39892#M23356</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-02T15:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add Column Data from One Table to Already Existing Table</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39895#M23359</link>
      <description>&lt;P&gt;Thanks for the quick reply! This syntax works much better for populating a new table with the values I need. This still produces an entirely new table, so is there any way that I can set a reference to it so that I may concatenate it to my "Stan and Lanmore" table? Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noah&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 15:30:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39895#M23359</guid>
      <dc:creator>nqj</dc:creator>
      <dc:date>2017-06-02T15:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add Column Data from One Table to Already Existing Table</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39897#M23361</link>
      <description>&lt;P&gt;My comment on the "UPDATE" option will handle that. &amp;nbsp;Just add&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Update,&lt;/P&gt;
&lt;P&gt;to your Join, and it will handle what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 15:35:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39897#M23361</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-02T15:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add Column Data from One Table to Already Existing Table</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39898#M23362</link>
      <description>&lt;P&gt;I was able to set a reference by adding the following to the code you proposed above:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;toBeConcat = dt2 &amp;lt;&amp;lt; Join(
	With( Data Table( output ) ),
	"Stanmore and Lam",
	Update,
	By Matching Columns(
		:Name( "Y (coronal) mm" ) = :Name( "Y (coronal) mm" ),
		:Name( "X (sagittal) mm" ) = :Name( "X (sagittal) mm" )
		
	)
);
dt2 &amp;lt;&amp;lt; Concatenate( toBeConcat, append to first table );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This 1) updates the format of my output to fit that of the Stanmore and Lam table and 2) concatenates that output to the original table without creating a new output data table. So now the code does exactly what I need it to. Thanks so much for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 15:43:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Column-Data-from-One-Table-to-Already-Existing-Table/m-p/39898#M23362</guid>
      <dc:creator>nqj</dc:creator>
      <dc:date>2017-06-02T15:43:54Z</dc:date>
    </item>
  </channel>
</rss>

