<?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: Find and insert matching rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524379#M74910</link>
    <description>&lt;P&gt;Create your Column B in a separate data table&amp;nbsp; and then use&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&lt;/P&gt;
&lt;P&gt;to merge the 2 tables together, matching Column A from&amp;nbsp; data table 1 with Column B from data table 2.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2022 08:49:38 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-07-21T08:49:38Z</dc:date>
    <item>
      <title>Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524362#M74909</link>
      <description>&lt;P&gt;I have two columns, ColumnA and ColumnB. Is it possible to put their matching value with Column B? Column B values are from this list (here's the snippet code)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fileNames = Files In Directory( directory );
newlist = {};
For( i = 1, i &amp;lt;= N Items( fileNames ), i++, 
	Insert Into( newlist, fileNames[i] )
);
dt &amp;lt;&amp;lt; New Column( "COlumn B", Character, Values( newlist ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Column A&lt;/TD&gt;&lt;TD&gt;Column B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apple.doc&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Orange.doc&lt;/TD&gt;&lt;TD&gt;Orange.doc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grapes.doc&lt;/TD&gt;&lt;TD&gt;Grapes.doc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Strawberry.doc&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mango.doc&lt;/TD&gt;&lt;TD&gt;Mango.doc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:51:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524362#M74909</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T23:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524379#M74910</link>
      <description>&lt;P&gt;Create your Column B in a separate data table&amp;nbsp; and then use&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&lt;/P&gt;
&lt;P&gt;to merge the 2 tables together, matching Column A from&amp;nbsp; data table 1 with Column B from data table 2.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 08:49:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524379#M74910</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-21T08:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524826#M74932</link>
      <description>&lt;P&gt;In addition to Join Tables from Jim this would be another solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Prepare Table with Column A
dt = New Table( "Column A",
Add Rows( 5 ),
New Column( "Column A", Character, "Nominal", Set Values( {"Apple.doc", "Orange.doc", "Grapes.doc", "Strawberry.doc", "Mango.doc"} ) )
);

// Get the list
newlist = {"Orange.doc", "Grapes.doc", "Mango.doc"};

dt &amp;lt;&amp;lt; New Column( "Column B", Character );

// Check each row if value is part of the list
For Each Row( dt, If( Contains( newlist, :"Column A"n ), :"Column B"n = :"Column A"n ) );

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;edited just to make it more clear&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 17:34:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524826#M74932</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2022-07-21T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524830#M74933</link>
      <description>&lt;P&gt;One more option, quite close to the one&amp;nbsp; &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt; provided&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	New Column("Column A",
		Character,
		"Nominal",
		Set Values({"Apple.doc", "Orange.doc", "Grapes.doc", "Strawberry.doc", "Mango.doc"})
	)
);

newlist = {"Orange.doc", "Grapes.doc", "Mango.doc"};

dt &amp;lt;&amp;lt; New Column("Column B", Character, Nomimal,
	&amp;lt;&amp;lt; Set Each Value(
		If(Contains(newlist, :"Column A"n),
			:"Column A"n
		,
			""
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 17:53:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/524830#M74933</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-21T17:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/525028#M74951</link>
      <description>&lt;P&gt;Thank you all for your response. It works well.&amp;nbsp;&lt;BR /&gt;I just want to know what does n means in&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;:"Column A"n&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jul 2022 01:56:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/525028#M74951</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2022-07-22T01:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Find and insert matching rows</title>
      <link>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/525070#M74953</link>
      <description>&lt;P&gt;It is something that has replaced Name() (in JMP16 I think). It is needed if there are some specific special characters for example in column names. Here is one help article which mentions it (there is better one, but couldn't quickly find it)&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/16.2/index.shtml#page/jmp/names.shtml" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; JSL Building Blocks &amp;gt; JSL Syntax Rules &amp;gt; Names&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;I used it because I don't trust spaces in my column names even though they should be ok in JMP.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 05:08:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Find-and-insert-matching-rows/m-p/525070#M74953</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-22T05:08:22Z</dc:date>
    </item>
  </channel>
</rss>

