<?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 Joining tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53206#M30117</link>
    <description>&lt;P&gt;I have to join two tables &amp;nbsp;using jsl. The first table looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example 1.PNG" style="width: 409px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9858i373E595D1622411E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example 1.PNG" alt="Example 1.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the second table can either be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example2.PNG" style="width: 667px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9859i1F2F1E9ECD6916C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example2.PNG" alt="Example2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this table, Pred Form Molecule 1 (%)(2) is the same as Molecule 1(%) and the numbers in the value column are repeated. How can I specify the join to only consider one of those values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second table to join can look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example3.PNG" style="width: 420px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9860i1B558E2EBABB80F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example3.PNG" alt="Example3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, how can I specify in the join that Molecule 1 (%) in the first table is the same as Pred Form Molecule1 (%)(2) in the table that needs to be joined.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final table that I need should be something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example4.PNG" style="width: 534px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9861iD15DD960C7B723C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example4.PNG" alt="Example4.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Mar 2018 23:37:45 GMT</pubDate>
    <dc:creator>Aam_jmp</dc:creator>
    <dc:date>2018-03-15T23:37:45Z</dc:date>
    <item>
      <title>Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53206#M30117</link>
      <description>&lt;P&gt;I have to join two tables &amp;nbsp;using jsl. The first table looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example 1.PNG" style="width: 409px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9858i373E595D1622411E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example 1.PNG" alt="Example 1.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the second table can either be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example2.PNG" style="width: 667px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9859i1F2F1E9ECD6916C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example2.PNG" alt="Example2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this table, Pred Form Molecule 1 (%)(2) is the same as Molecule 1(%) and the numbers in the value column are repeated. How can I specify the join to only consider one of those values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second table to join can look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example3.PNG" style="width: 420px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9860i1B558E2EBABB80F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example3.PNG" alt="Example3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, how can I specify in the join that Molecule 1 (%) in the first table is the same as Pred Form Molecule1 (%)(2) in the table that needs to be joined.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final table that I need should be something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example4.PNG" style="width: 534px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9861iD15DD960C7B723C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example4.PNG" alt="Example4.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 23:37:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53206#M30117</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-03-15T23:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53210#M30118</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11322"&gt;@Aam_jmp&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Inner Join between tables will look for the columns to match . Can you rename rows that are the same in table 2 ? That will automatically give the result that you want. Unless your rows are too many where you can't keep track, this is one way to do it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:56:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53210#M30118</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T16:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53216#M30122</link>
      <description>&lt;P&gt;How can I manipulate the names in column to look the same as the table that it needs to join to?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 17:52:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53216#M30122</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-03-15T17:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53221#M30125</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11322"&gt;@Aam_jmp&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;2 steps.&lt;/P&gt;&lt;P&gt;Step 1: Extract the values of titles in table 1&lt;/P&gt;&lt;P&gt;Step 2: Loop through the titles in table 1 and look for similar names in table 2, then update the row to reflect the same&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 18:43:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53221#M30125</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T18:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53222#M30126</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Cols &amp;gt; Utilities &amp;gt; Recode&lt;/STRONG&gt; will allow you to change values to standard values.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 18:45:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53222#M30126</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-03-15T18:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53244#M30138</link>
      <description>&lt;P&gt;Uday, I am not even able to extract the column names I guess because of the numbers and "%" sign in them. Can you direct me as to how I can do it? For now, I am working on this script to extract the names. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = Open( "C:\Users\filepath\try1.jmp" );&lt;/P&gt;&lt;P&gt;col_names = dt &amp;lt;&amp;lt; Get Column Names();&lt;/P&gt;&lt;P&gt;Show(col_names);&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 21:18:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53244#M30138</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-03-15T21:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53245#M30139</link>
      <description>&lt;P&gt;&amp;nbsp;How do you recode column names?&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;Also, the Recode option is greyed out for my table.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 21:27:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53245#M30139</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-03-15T21:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53248#M30141</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11322"&gt;@Aam_jmp&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;See below some sample code. This should work for any data table in JMP. If it is not, I would request you share a sample of your data tables and I can try to see what the issue is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log(); Clear Globals(); 

// Open Sample Data 
dt = Open( "$SAMPLE_DATA/Cities.jmp" );

// Extract Column Names
ColNames = dt &amp;lt;&amp;lt; Get Column Names("String"); 

// Extract Rows from a column 
Cities = dt:city &amp;lt;&amp;lt; Get Values; 

// Change Column Name 
Col = Column(dt,1); 
Col &amp;lt;&amp;lt; Set Name("City_Edit");

// Change Row Values 
dt:City_Edit[7] = "TEMPE"; 


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 22:08:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53248#M30141</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T22:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53249#M30142</link>
      <description>&lt;P&gt;Hi Uday,&amp;nbsp;I have added the tables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 23:38:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53249#M30142</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-03-15T23:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53258#M30147</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11322"&gt;@Aam_jmp&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tested this code using tables try and join. You can expand it appropriately to include try1 if needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log(); Clear Globals(); 

// Open Data Tables 
dt1 = Open(FilePath1); // Where FilePath1 points to your file location for JOIN table 
dt2 = Open(FilePath2); // Where FilePath2 points to your file location for try table 

// Get Y values from main table 
YVals = dt1:Y &amp;lt;&amp;lt; Get Values; 

// Get Col values from second table 
ColVals = dt2:Col &amp;lt;&amp;lt; Get Values; 

// Loop through the values 
for(i = 1, i &amp;lt;= N Items(YVals), i++,
		for(r = 1, r &amp;lt;= N Items(ColVals), r++,
				If(Contains(ColVals[r],YVals[i]),
					ColVals[r] = YVals[i];
				  );
		   );	
   );

// Assign Corrected Values back to dt2 
dt2 &amp;lt;&amp;lt; New Column("CorrectedCol",Character,Continuous, &amp;lt;&amp;lt; Set Values(ColVals)); 

// Join Tables 
dt_Intermediate = dt1 &amp;lt;&amp;lt; Join(With(dt2 ),
								Select( :Y, :Quan Reqd ),
								SelectWith( :Value ),
								By Matching Columns( :Y = :CorrectedCol ),
								Drop multiples( 0, 0 ),
								Include Nonmatches( 0, 0 ),
								Preserve main table order( 1 )
							);
							
// Remove Duplicates 
dt_Results = dt_Intermediate &amp;lt;&amp;lt; Summary(
											Group( :Y, :Quan Reqd, :Value ),
											Freq( "None" ),
											Weight( "None" )
									   );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9875i6F280EC0B54BB2D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 03:04:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53258#M30147</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-16T03:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53260#M30148</link>
      <description>&lt;P&gt;You can use the Search(Find) dialog to change column names, or parts of column names&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="find.PNG" style="width: 399px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9876iD33C4C66251723A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="find.PNG" alt="find.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 03:35:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53260#M30148</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-16T03:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53272#M30154</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If I may, I would like to ask one question, why would you recommend column names be recoded / renamed given the table structure?&amp;nbsp; The current structure of the table shared shows that the data is in the rows. While I understand, that one can always transpose the data and rename columns, wondering if that is the approach you are recommending ? Please advice&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:25:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53272#M30154</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-16T13:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53274#M30156</link>
      <description>&lt;P&gt;I was suggesting recode to change &lt;U&gt;values&lt;/U&gt; in a column, not change the name of the column.&amp;nbsp; To use the recode option, highlight the column you wish to recode, and click on &lt;STRONG&gt;Cols &amp;gt; Utilities &amp;gt; Recode&lt;/STRONG&gt; (v12) or &lt;STRONG&gt;Cols &amp;gt; Recode&lt;/STRONG&gt; (v13).&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:34:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53274#M30156</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-03-16T13:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53275#M30157</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Thank you for clarifying. My bad, was wondering if there was a better way to approach this that I was missing.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;wrote:&lt;BR /&gt;&lt;P&gt;I was suggesting recode to change &lt;U&gt;values&lt;/U&gt; in a column, not change the name of the column.&amp;nbsp; To use the recode option, highlight the column you wish to recode, and click on &lt;STRONG&gt;Cols &amp;gt; Utilities &amp;gt; Recode&lt;/STRONG&gt; (v12) or &lt;STRONG&gt;Cols &amp;gt; Recode&lt;/STRONG&gt; (v13).&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:35:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Joining-tables/m-p/53275#M30157</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-16T13:35:36Z</dc:date>
    </item>
  </channel>
</rss>

