<?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 Filter row item by comparing multiple parameters related the item using a script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426513#M67631</link>
    <description>&lt;P&gt;I have attached example data from which I need to extract the row for which the yield is minimum for a given PartID. I would like to do this using a script.&lt;/P&gt;&lt;P&gt;This I need to do for each PartID and then have a table with only the filtered rows (i.e. [PartID], [Parameter] [(min-) Yeild]).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SampleData.PNG" style="width: 209px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36574i6E73420DD8F0ED44/image-size/large?v=v2&amp;amp;px=999" role="button" title="SampleData.PNG" alt="SampleData.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note, I have deliberately put identical yield for part C as I may have similar data and would like to handle such using the script. I am on JMP13.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:38:30 GMT</pubDate>
    <dc:creator>Neo</dc:creator>
    <dc:date>2023-06-10T23:38:30Z</dc:date>
    <item>
      <title>Filter row item by comparing multiple parameters related the item using a script</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426513#M67631</link>
      <description>&lt;P&gt;I have attached example data from which I need to extract the row for which the yield is minimum for a given PartID. I would like to do this using a script.&lt;/P&gt;&lt;P&gt;This I need to do for each PartID and then have a table with only the filtered rows (i.e. [PartID], [Parameter] [(min-) Yeild]).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SampleData.PNG" style="width: 209px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36574i6E73420DD8F0ED44/image-size/large?v=v2&amp;amp;px=999" role="button" title="SampleData.PNG" alt="SampleData.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note, I have deliberately put identical yield for part C as I may have similar data and would like to handle such using the script. I am on JMP13.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:38:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426513#M67631</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-10T23:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter row item by comparing multiple parameters related the item using a script</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426522#M67634</link>
      <description>&lt;P&gt;Here is one way to handle your request:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

Summarize( dt, thePartID = by( :PartID ), theMin = Minimum( :Parameter ) );

dt &amp;lt;&amp;lt; clear select;

For( i = 1, i &amp;lt;= N Items( thePartID ), i++,
	dt &amp;lt;&amp;lt; select where(
		:PartID == thePartID[i] &amp;amp; :Parameter == theMin[i],
		current selection( "extend" )
	)
);

dtSelected = dt &amp;lt;&amp;lt; subset( selected rows(1), selected columns(0));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 16:07:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426522#M67634</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-14T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filter row item by comparing multiple parameters related the item using a script</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426559#M67638</link>
      <description>&lt;P&gt;Thanks. Running your script directly gives me the following error&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Column Must be Numeric in access or evaluation of 'Parameter' , :Parameter/*###*/

In the following script, error marked by /*###*/
dt = Current Data Table();
Summarize( dt, thePartID = by( :PartID ), theMin = Minimum( :Parameter/*###*/ ) );
dt &amp;lt;&amp;lt; clear select;
For( i = 1, i &amp;lt;= N Items( thePartID ), i++,
	dt &amp;lt;&amp;lt; select where(
		:PartID == thePartID[i] &amp;amp; :Parameter == theMin[i],
		current selection( "extend" )
	)
);
dtSelected = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps the third line should be&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Summarize( dt, thePartID = by( :PartID ), theMin = Minimum( :Yield) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Anyway running the script give me with the above line.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Empty()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have attached the data table with script inside.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 17:52:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426559#M67638</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2021-10-14T17:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter row item by comparing multiple parameters related the item using a script</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426572#M67639</link>
      <description>&lt;P&gt;Ok figured it out, the corrected script is (it should be &lt;CODE class=""&gt;theMin = Minimum( :Yield) &lt;/CODE&gt;inside the for loop as well)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

Summarize( dt, thePartID = by( :PartID ), theMin = Minimum( :Yield) );

dt &amp;lt;&amp;lt; clear select;

For( i = 1, i &amp;lt;= N Items( thePartID ), i++,
	dt &amp;lt;&amp;lt; select where(
		:PartID == thePartID[i] &amp;amp; :Yield == theMin[i],
		current selection( "extend" )
	)
);

dtSelected = dt &amp;lt;&amp;lt; subset( selected rows(1), selected columns(0));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 18:02:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426572#M67639</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2021-10-14T18:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter row item by comparing multiple parameters related the item using a script</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426579#M67641</link>
      <description>&lt;P&gt;Sorry for the misdirection......I made up a data table to test the script on, and in error, I used the :Parameter name as the target column, instead of the &lt;SPAN class="lia-emoticons-autosuggestions"&gt;&lt;SPAN class="lia-emoticons-search-term"&gt;:Yield column.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 18:05:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-row-item-by-comparing-multiple-parameters-related-the/m-p/426579#M67641</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-14T18:05:44Z</dc:date>
    </item>
  </channel>
</rss>

