<?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: Quick way to compare two lists (uncommon elements)? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/5812#M5811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to know that too. Common items are can be found with Intersect() (see below) but I am not aware of a corresponding function for uncommon items. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are more options for data tables than for lists. The script below identifies the uncommon elements via a temporary datatable. It may be faster than looping through long lists but I have not compared&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #a70096;"&gt;&lt;SPAN style="color: #000000;"&gt;list1 &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;"apple"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"pear"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"orange"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"kiwi"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"watermelon"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"mango"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #a70096;"&gt;&lt;SPAN style="color: #000000;"&gt;list2 &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;"apple"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"pear"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"kiwi"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"orange"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"strawberry"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"watermelon"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"melon"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #2600eb;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;New Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a70096;"&gt;"temp"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2600eb;"&gt;New Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #a70096;"&gt;"gr"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; character&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; setvalues&lt;STRONG&gt;(&lt;/STRONG&gt; list1 &lt;SPAN style="color: #150097;"&gt;||&lt;/SPAN&gt; list2 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2600eb;"&gt;New Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #a70096;"&gt;"nr"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; numeric&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; evalformula &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; invisible&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Summarize&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; g &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; by&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;:&lt;/SPAN&gt;gr &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; n &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;Count&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;:&lt;/SPAN&gt;nr &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;not_in_common &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; g&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #2600eb;"&gt;Loc&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #2600eb;"&gt;As List&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; n &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;)]&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;common &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;Associative Array&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; list1 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #150097;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; intersect&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #2600eb;"&gt;Associative Array&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; list2 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #150097;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; getkeys&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Show&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; common&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; not_in_common &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Close&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; nosave &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Oct 2012 00:06:11 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2012-10-20T00:06:11Z</dc:date>
    <item>
      <title>Quick way to compare two lists and identify the uncommon elements</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/5811#M5810</link>
      <description>&lt;P&gt;Does anyone know a quick way to compare two lists and identify any different list elements (i.e. uncommon elements)?&amp;nbsp; I can do this using two, nested loops, but like many things in JSL I was hoping there might be some obscure, easier way .&amp;nbsp; dj&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My lists are much larger than this of course:&lt;/P&gt;
&lt;P&gt;list1={"apple","pear","orange","kiwi","watermelon"};&lt;/P&gt;
&lt;P&gt;list2={"apple","pear","orange","kiwi","strawberry","watermelon"};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Find any different/uncommon elements, in this case "strawberry".&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:30:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/5811#M5810</guid>
      <dc:creator>djhanson</dc:creator>
      <dc:date>2017-09-20T20:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/5812#M5811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to know that too. Common items are can be found with Intersect() (see below) but I am not aware of a corresponding function for uncommon items. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are more options for data tables than for lists. The script below identifies the uncommon elements via a temporary datatable. It may be faster than looping through long lists but I have not compared&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #a70096;"&gt;&lt;SPAN style="color: #000000;"&gt;list1 &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;"apple"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"pear"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"orange"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"kiwi"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"watermelon"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"mango"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #a70096;"&gt;&lt;SPAN style="color: #000000;"&gt;list2 &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;"apple"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"pear"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"kiwi"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"orange"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"strawberry"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"watermelon"&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"melon"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #2600eb;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;New Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a70096;"&gt;"temp"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2600eb;"&gt;New Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #a70096;"&gt;"gr"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; character&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; setvalues&lt;STRONG&gt;(&lt;/STRONG&gt; list1 &lt;SPAN style="color: #150097;"&gt;||&lt;/SPAN&gt; list2 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &lt;SPAN style="color: #2600eb;"&gt;New Column&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #a70096;"&gt;"nr"&lt;/SPAN&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; numeric&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; formula&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; evalformula &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; invisible&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Summarize&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; g &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; by&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;:&lt;/SPAN&gt;gr &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; n &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;Count&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;:&lt;/SPAN&gt;nr &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;not_in_common &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; g&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #2600eb;"&gt;Loc&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #2600eb;"&gt;As List&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; n &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009694;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;)]&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;common &lt;SPAN style="color: #150097;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #2600eb;"&gt;Associative Array&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; list1 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #150097;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; intersect&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #2600eb;"&gt;Associative Array&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; list2 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #150097;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; getkeys&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Show&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; common&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; not_in_common &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #2600eb;"&gt;Close&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; dt&lt;SPAN style="color: #150097;"&gt;,&lt;/SPAN&gt; nosave &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #150097;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2012 00:06:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/5812#M5811</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2012-10-20T00:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34320#M20335</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; This solution that you have offered has been extremely helpful to me in many different ways so far and I want to thank you for it first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I would also like to inquire that when we are dealing with really large sets of data ( for e.g. a couple of million items each ) , this approach will require large amounts of memory and inserting the elements into a new table doesn't seem efficient. Is there a more effective way to identify uncommon elements between two columns in two data tables i.e. If Column 1 in Data Table 1 (dt1) and Column 1 in Data Table 2 (dt2) have a large list of &amp;nbsp;numbers, can we compare them in a more effective way ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&amp;nbsp;&lt;BR /&gt;uday&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 14:05:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34320#M20335</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-01-10T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34321#M20336</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;set1=associativearray({"apple","grape","orange","kiwi","watermelon"});
set2=associativearray({"apple","pear","orange","kiwi","strawberry","watermelon"});
set3=associativearray({"apple","pear","watermelon"});
intersection=set1;intersection&amp;lt;&amp;lt;Intersect(set2);
print("common (intersection) items:",intersection&amp;lt;&amp;lt;getkeys);
union=set1;union&amp;lt;&amp;lt;insert(set2);
print("all (union) items", union&amp;lt;&amp;lt;getkeys);
set1HasSet3=set1;show(set1HasSet3&amp;lt;&amp;lt;contains(set3));
set2HasSet3=set2;show(set2HasSet3&amp;lt;&amp;lt;contains(set3));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;"common (intersection) items:"
{"apple", "kiwi", "orange", "watermelon"}
"all (union) items"
{"apple", "grape", "kiwi", "orange", "pear", "strawberry", "watermelon"}
set1HasSet3 &amp;lt;&amp;lt; Contains(set3) = 0;
set2HasSet3 &amp;lt;&amp;lt; Contains(set3) = 1;&lt;/PRE&gt;
&lt;P&gt;The associative arrays are very good for millions of values, especially compared to writing a JSL script that loops over millions of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The scripting index has the details for the associative array being used as a set. &amp;nbsp;Here's the uncommon items:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;set1=associativearray({"apple","grape","orange","kiwi","watermelon"});
set2=associativearray({"apple","pear","orange","kiwi","strawberry","watermelon"});
intersection=set1;intersection&amp;lt;&amp;lt;Intersect(set2);
print("common (intersection) items:",intersection&amp;lt;&amp;lt;getkeys);
uncommon1 = set1; uncommon1&amp;lt;&amp;lt;remove(intersection);show(uncommon1&amp;lt;&amp;lt;getkeys);
uncommon2 = set2; uncommon2&amp;lt;&amp;lt;remove(intersection);show(uncommon2&amp;lt;&amp;lt;getkeys);
/*:

"common (intersection) items:"
{"apple", "kiwi", "orange", "watermelon"}
uncommon1 &amp;lt;&amp;lt; getkeys = {"grape"};
uncommon2 &amp;lt;&amp;lt; getkeys = {"pear", "strawberry"};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 14:41:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34321#M20336</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-10T14:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34322#M20337</link>
      <description>&lt;P&gt;Also: if the members of the set are named with consecutive integers, starting at 1, this problem could be done very efficiently with a matrix. &amp;nbsp;But, as presented with named set members, an associative array is probably better than sorting, and definitely better than an N^2 pair of nested loops.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 14:48:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34322#M20337</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-10T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34323#M20338</link>
      <description>&lt;P&gt;And the uncommon method does not require finding the intersection first. &amp;nbsp;It's just the difference.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;set1=associativearray({"apple","grape","orange","kiwi","watermelon"});
set2=associativearray({"apple","pear","orange","kiwi","strawberry","watermelon"});
uncommon1 = set1; uncommon1&amp;lt;&amp;lt;remove(set2);show(uncommon1&amp;lt;&amp;lt;getkeys);
uncommon2 = set2; uncommon2&amp;lt;&amp;lt;remove(set1);show(uncommon2&amp;lt;&amp;lt;getkeys);
/*:

uncommon1 &amp;lt;&amp;lt; getkeys = {"grape"};
uncommon2 &amp;lt;&amp;lt; getkeys = {"pear", "strawberry"};&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jan 2017 15:08:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34323#M20338</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-10T15:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34799#M20553</link>
      <description>&lt;P&gt;Quick question for this, is&amp;nbsp;the time saved using the associative array vs the loop pretty much always larger than the overhead it takes to create the associative array vs the list? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 19:54:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34799#M20553</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-01-20T19:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way to compare two lists (uncommon elements)?</title>
      <link>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34807#M20560</link>
      <description>&lt;P&gt;You would have to benchmark it for different sizes and for different JSL loop approaches. I'd guess somewhere between 2&amp;nbsp;and 10 items in the set would be faster with the associative array. At size 1, the associative array is overkill, but it still constructs pretty fast...about a million per second...&lt;/P&gt;
&lt;PRE&gt;start = tickseconds();&lt;BR /&gt;for(i=1,i&amp;lt;=1e6,i++,&lt;BR /&gt;a=associativearray({"a","b"});&lt;BR /&gt;b=associativearray({"a","b"});&lt;BR /&gt;c=associativearray({"a","b"});&lt;BR /&gt;d=associativearray({"a","b"});&lt;BR /&gt;e=associativearray({"a","b"}); &lt;BR /&gt;);&lt;BR /&gt;stop=tickseconds();&lt;BR /&gt;aatime=(stop-start);&lt;BR /&gt;write("\!ntime for 5,000,000 associative arrays:",aatime);&lt;BR /&gt;&lt;BR /&gt;start = tickseconds();&lt;BR /&gt;for(i=1,i&amp;lt;=1e6,i++,&lt;BR /&gt;a=1;&lt;BR /&gt;b=2;&lt;BR /&gt;c=3;&lt;BR /&gt;d=4;&lt;BR /&gt;e=5; &lt;BR /&gt;);&lt;BR /&gt;stop=tickseconds();&lt;BR /&gt;satime=(stop-start);&lt;BR /&gt;write("\!ntime for 5,000,000 simple assingments:",satime);&lt;BR /&gt;&lt;BR /&gt;write("\!nsimple/associative=", satime/aatime);&lt;BR /&gt;&lt;BR /&gt;/*:&lt;BR /&gt;&lt;BR /&gt;time for 5,000,000 associative arrays:5.8166666666657&lt;BR /&gt;time for 5,000,000 simple assingments:0.283333333325572&lt;BR /&gt;simple/associative=0.0487106017178716&lt;/PRE&gt;
&lt;P&gt;You probably can't run more than about 20-30 simple JSL statements for each associative array you create.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 22:10:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Quick-way-to-compare-two-lists-and-identify-the-uncommon/m-p/34807#M20560</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-20T22:10:50Z</dc:date>
    </item>
  </channel>
</rss>

