<?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: subset data table based on another data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312986#M56570</link>
    <description>&lt;P&gt;Excellent! I have to comment in some point. Manual is not enough. I scan through the manual and there is no close example case to my question. Do you have better source that we can find some use cases of the functions ?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 13:54:53 GMT</pubDate>
    <dc:creator>joshua</dc:creator>
    <dc:date>2020-09-25T13:54:53Z</dc:date>
    <item>
      <title>subset data table based on another data table</title>
      <link>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312020#M56509</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets say we have main data table and there is another data table we want to use to subset the main one + add some conditionals during this process;&lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;main table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 225px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26957i23E6837B1E6483DC/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;Another data table&lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 243px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26959i50057398B7099377/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;
&lt;P&gt;How can go through each row of Label column in main table to get the rows matched to subset tables rows (L1, L3, L5) and get rows when group == K and Number == 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the output table should look like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 206px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26960i1FBD840D81A00CD2/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;
&lt;P&gt;Please provide the solution with for loop or whatever is out there and don't use and short list like list = {K1, K3, K5} because in my real data I have 1000's of rows.&lt;LI-MESSAGE title="How to select rows based on multiple criteria?" uid="7014" url="https://community.jmp.com/t5/Discussions/How-to-select-rows-based-on-multiple-criteria/m-p/7014#U7014" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:19:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312020#M56509</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2023-06-10T23:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: subset data table based on another data table</title>
      <link>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312200#M56514</link>
      <description>&lt;P&gt;Here is a sample of one way of doing what you want.&lt;/P&gt;
&lt;P&gt;I recommend you take the time and read the Using JMP and Scripting Guide documentation from the JMP Documentation Library, under the Help pull down menu.&amp;nbsp; It will open the window on the various ways to use the objects within JMP and to not be limited to thinking that every thing needs to be coded in a traditional programming methodology.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt1=data table("main_table");
dt2=data table("subset_table");
dt2b = dt2 &amp;lt;&amp;lt; subset(selected rows(0), columns(:label));

dtFinal = dt1 &amp;lt;&amp;lt; Join(
	with(dt2b),
	Match Flag( 1 ),
	By Matching Columns( :Label = :Label ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 1, 1 ),
	Preserve main table order( 1 ),
	merge same name columns( 1 )
);

close( dt2b, nosave );

dtFinal &amp;lt;&amp;lt; select where(:match flag == 3 | (:Group == "K" &amp;amp; :Number == 2) );
dtFinal &amp;lt;&amp;lt; invert row selection;
dtFinal &amp;lt;&amp;lt; delete rows;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Sep 2020 13:04:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312200#M56514</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-24T13:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: subset data table based on another data table</title>
      <link>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312986#M56570</link>
      <description>&lt;P&gt;Excellent! I have to comment in some point. Manual is not enough. I scan through the manual and there is no close example case to my question. Do you have better source that we can find some use cases of the functions ?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 13:54:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/312986#M56570</guid>
      <dc:creator>joshua</dc:creator>
      <dc:date>2020-09-25T13:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: subset data table based on another data table</title>
      <link>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/313026#M56574</link>
      <description>Scanning the manual doe not work...you need to read the manual...it provides the structures for you to build on</description>
      <pubDate>Fri, 25 Sep 2020 15:12:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/subset-data-table-based-on-another-data-table/m-p/313026#M56574</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-25T15:12:22Z</dc:date>
    </item>
  </channel>
</rss>

