<?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: How to find intersection of two tables column names? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53102#M30057</link>
    <description>&lt;P&gt;1=data came only from data table 1&lt;/P&gt;
&lt;P&gt;2=data came only from data table 2&lt;/P&gt;
&lt;P&gt;3=data came from both data tables(a match)&lt;/P&gt;
&lt;P&gt;See page 288 in the Using JMP documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 23:33:40 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-03-13T23:33:40Z</dc:date>
    <item>
      <title>How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53080#M30035</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two data tables with similar column names and like to write a script to find the overlap (intersection) of two column names and write the interesection into a new data table. I tried using Tables and join and did not work for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:56:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53080#M30035</guid>
      <dc:creator>AT</dc:creator>
      <dc:date>2018-03-13T17:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53085#M30040</link>
      <description>&lt;P&gt;Here is a simple example of how to do this.&amp;nbsp; I am not sure of what the final combined data table is, so I guessed it had to be a concatenation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dtA = Open("$SAMPLE_DATA\Big Class.jmp");
dtB = Open("$SAMPLE_DATA\Big Class Families.jmp");

dtACol = New Table("A Columns", private,
	New Column("A", character, values(dtA&amp;lt;&amp;lt;get column names))
);
dtBCol = New Table("B Columns", private,
	New Column("B", character, values(dtB&amp;lt;&amp;lt;get column names))
);

dtJoin = dtACol &amp;lt;&amp;lt; Join( private,
	With( dtBCol ),
	By Matching Columns( :A = :B ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 )
);

CommonColList = dtJoin:A &amp;lt;&amp;lt; getvalues;

dtAsubset = dtA &amp;lt;&amp;lt; subset( private, selected rows(0), columns(CommonColList));
dtBsubset = dtB &amp;lt;&amp;lt; subset( private, selected rows(0), columns(CommonColList));

dtFinal = dtAsubset &amp;lt;&amp;lt; Concatenate( dtBsubset );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Mar 2018 19:32:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53085#M30040</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-13T19:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53090#M30045</link>
      <description>&lt;P&gt;Thanks Jim. My data tables are not equal in number of rows and the final table should be the intersection of the the two similar columns. I have for instance 25 rows in table A and 25 rows in table B and the output should be the two rows that is not comon between similar columns.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 21:35:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53090#M30045</guid>
      <dc:creator>AT</dc:creator>
      <dc:date>2018-03-13T21:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53094#M30049</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10363"&gt;@AT&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtA = Open("$SAMPLE_DATA\Big Class.jmp");
dtB = Open("$SAMPLE_DATA\Big Class Families.jmp");

ACols = Associative Array(dtA &amp;lt;&amp;lt; Get Column Names("String")); 
BCols = Associative Array(dtB &amp;lt;&amp;lt; Get Column Names("String")); 
Intersection = ACols ;
Intersection &amp;lt;&amp;lt; Intersect(BCols); 
Res = Intersection &amp;lt;&amp;lt; Get Keys;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can you work with the common columns being outside the data table and then defining a new table ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so, look at the above example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 21:50:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53094#M30049</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-13T21:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53095#M30050</link>
      <description>&lt;P&gt;OK, I am now totally confused......can you please provide a couple of input data tables and the desired outcome data table?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 21:58:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53095#M30050</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-13T21:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53096#M30051</link>
      <description>&lt;P&gt;Thanks. I tried it and did not see output table. I have attached my two input data tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 22:08:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53096#M30051</guid>
      <dc:creator>AT</dc:creator>
      <dc:date>2018-03-13T22:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53097#M30052</link>
      <description>&lt;P&gt;Is this what you want?&amp;nbsp; Note the Match Flag value for the rows not found in both data tables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
input = Data Table( "input" );
output = Data Table( "output" );

dtFinal = input &amp;lt;&amp;lt; Join(
	With( Output ),
	Match Flag( 1 ),
	By Matching Columns( :boardno = :boardno ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 1, 1 ),
	Preserve main table order( 1 ),
	Merge same name columns( 1 )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Mar 2018 22:20:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53097#M30052</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-13T22:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53099#M30054</link>
      <description>&lt;P&gt;Thanks. I have attached the output. It is 25 rows with Match Flag 3 and only two with Match Flag 1. I was expecting only two rows with no match. What does Match Flag 1 and 3 mean? (freuqnecy?).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 22:48:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53099#M30054</guid>
      <dc:creator>AT</dc:creator>
      <dc:date>2018-03-13T22:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53102#M30057</link>
      <description>&lt;P&gt;1=data came only from data table 1&lt;/P&gt;
&lt;P&gt;2=data came only from data table 2&lt;/P&gt;
&lt;P&gt;3=data came from both data tables(a match)&lt;/P&gt;
&lt;P&gt;See page 288 in the Using JMP documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 23:33:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53102#M30057</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-13T23:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find intersection of two tables column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53164#M30096</link>
      <description>&lt;P&gt;Thanks Jim.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 22:21:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-intersection-of-two-tables-column-names/m-p/53164#M30096</guid>
      <dc:creator>AT</dc:creator>
      <dc:date>2018-03-14T22:21:42Z</dc:date>
    </item>
  </channel>
</rss>

