<?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: Selecting duplicates from different source columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655122#M84427</link>
    <description>&lt;P&gt;I think you need to take a different approach.&amp;nbsp; Your submitted JSL has a couple of issues, and a misinterpretation of the Select Duplicate Rows function.&lt;/P&gt;
&lt;P&gt;Your Concatenation statement creates a new data table where your data table dt1 is replicated twice in the output table.&lt;/P&gt;
&lt;P&gt;The Select Duplicate Rows function only finds duplicates within the same column.&lt;/P&gt;
&lt;P&gt;I suggest you look into using the Join platform, which has the capability of determining which rows between the 2 data tables have duplicate values.&lt;/P&gt;
&lt;P&gt;Here is an example of comparing between 2 data tables and finding that the person named Robert is in both tables.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1688490605407.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54358i2EB892B0DC5E58D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1688490605407.png" alt="txnelson_0-1688490605407.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt1 = New Table( "one",
	Add Rows( 20 ),
	New Column( "name",
		Character,
		"Nominal",
		Set Values(
			{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE",
			"SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY", "ELIZABETH", "LESLIE", "CAROL", "PATTY"}
		)
	)
);

dt2 = New Table( "Two",
	Add Rows( 20 ),
	New Column( "name",
		Character,
		"Nominal",
		Set Values(
			{"FREDERICK", "ALFRED", "HENRY", "LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "AMY", "ROBERT",
			"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP", "LINDA", "KIRK", "LAWRENCE"}
		)
	)
);

dt3 = dt1 &amp;lt;&amp;lt; Join(
	With( dt2 ),
	Merge Same Name Columns,
	By Matching Columns( :name = :name ),
	Drop multiples( 1, 0 ),
	Include Nonmatches( 1, 1 ),
	Preserve main table order( 1 ),
	Output Table( "together" )
);

dt3 &amp;lt;&amp;lt; select where( :Match Flag == 3 );

//dt3 &amp;lt;&amp;lt; Delete Rows();
//dt3 &amp;lt;&amp;lt; delete columns(match flag);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Jul 2023 17:10:43 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-07-04T17:10:43Z</dc:date>
    <item>
      <title>Selecting duplicates from different source columns</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655048#M84420</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to select (and delete) duplicates after combining two data tables with a source column, I have 2 criteria for a selection:&lt;/P&gt;&lt;P&gt;-The duplicate values &lt;STRONG&gt;should&lt;/STRONG&gt; &lt;STRONG&gt;match&lt;/STRONG&gt; in 2 columns (Match :col1, :col2), works fine.&lt;/P&gt;&lt;P&gt;-The duplicate values &lt;STRONG&gt;should&lt;/STRONG&gt; &lt;STRONG&gt;not&lt;/STRONG&gt; have the same value in the generated source column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure how I can code the 2nd criterium, is there some simple != line or 'does not' match ':Source Table'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dt1 &amp;lt;&amp;lt; concatenate (dt1, dt2, append to first table(1), Create Source Column ) ;		
dt1 &amp;lt;&amp;lt; Select Duplicate Rows (Match (:col1, :col2)) ;

dt1 &amp;lt;&amp;lt; Delete Rows();&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jul 2023 12:09:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655048#M84420</guid>
      <dc:creator>Stijnw91</dc:creator>
      <dc:date>2023-07-04T12:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting duplicates from different source columns</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655122#M84427</link>
      <description>&lt;P&gt;I think you need to take a different approach.&amp;nbsp; Your submitted JSL has a couple of issues, and a misinterpretation of the Select Duplicate Rows function.&lt;/P&gt;
&lt;P&gt;Your Concatenation statement creates a new data table where your data table dt1 is replicated twice in the output table.&lt;/P&gt;
&lt;P&gt;The Select Duplicate Rows function only finds duplicates within the same column.&lt;/P&gt;
&lt;P&gt;I suggest you look into using the Join platform, which has the capability of determining which rows between the 2 data tables have duplicate values.&lt;/P&gt;
&lt;P&gt;Here is an example of comparing between 2 data tables and finding that the person named Robert is in both tables.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1688490605407.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54358i2EB892B0DC5E58D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1688490605407.png" alt="txnelson_0-1688490605407.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt1 = New Table( "one",
	Add Rows( 20 ),
	New Column( "name",
		Character,
		"Nominal",
		Set Values(
			{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE",
			"SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY", "ELIZABETH", "LESLIE", "CAROL", "PATTY"}
		)
	)
);

dt2 = New Table( "Two",
	Add Rows( 20 ),
	New Column( "name",
		Character,
		"Nominal",
		Set Values(
			{"FREDERICK", "ALFRED", "HENRY", "LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "AMY", "ROBERT",
			"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP", "LINDA", "KIRK", "LAWRENCE"}
		)
	)
);

dt3 = dt1 &amp;lt;&amp;lt; Join(
	With( dt2 ),
	Merge Same Name Columns,
	By Matching Columns( :name = :name ),
	Drop multiples( 1, 0 ),
	Include Nonmatches( 1, 1 ),
	Preserve main table order( 1 ),
	Output Table( "together" )
);

dt3 &amp;lt;&amp;lt; select where( :Match Flag == 3 );

//dt3 &amp;lt;&amp;lt; Delete Rows();
//dt3 &amp;lt;&amp;lt; delete columns(match flag);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jul 2023 17:10:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655122#M84427</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-07-04T17:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting duplicates from different source columns</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655311#M84439</link>
      <description>&lt;P&gt;Thanks Jim, this works well!&lt;/P&gt;&lt;P&gt;Happy to learn more about the Join function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stijn&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 07:49:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-duplicates-from-different-source-columns/m-p/655311#M84439</guid>
      <dc:creator>Stijnw91</dc:creator>
      <dc:date>2023-07-05T07:49:04Z</dc:date>
    </item>
  </channel>
</rss>

