<?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 Identify lowest 5 sequential rows byVar in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Identify-lowest-5-sequential-rows-byVar/m-p/662314#M85111</link>
    <description>&lt;P&gt;Suppose I have a table of RunNumber (1,2,3...) and Result (numeric/continuous).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create a formula column that identifies (e.g. with a "1") the sequence of 5 Result numbers with the lowest average value for each RunNumber, and a "0" everywhere else?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2023 22:19:14 GMT</pubDate>
    <dc:creator>BHarris</dc:creator>
    <dc:date>2023-07-25T22:19:14Z</dc:date>
    <item>
      <title>Identify lowest 5 sequential rows byVar</title>
      <link>https://community.jmp.com/t5/Discussions/Identify-lowest-5-sequential-rows-byVar/m-p/662314#M85111</link>
      <description>&lt;P&gt;Suppose I have a table of RunNumber (1,2,3...) and Result (numeric/continuous).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create a formula column that identifies (e.g. with a "1") the sequence of 5 Result numbers with the lowest average value for each RunNumber, and a "0" everywhere else?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 22:19:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Identify-lowest-5-sequential-rows-byVar/m-p/662314#M85111</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2023-07-25T22:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Identify lowest 5 sequential rows byVar</title>
      <link>https://community.jmp.com/t5/Discussions/Identify-lowest-5-sequential-rows-byVar/m-p/662322#M85113</link>
      <description>&lt;P&gt;While putting everything one would need to accomplish what you want into a column formula could be done, it is much simpler using a little script run in open code.&amp;nbsp; Here is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// create a column to represent the original order of the data
dt &amp;lt;&amp;lt; new column("Orig Row", set each value(row()));

// Find 5 lowest values of NPN1 for each site
dt &amp;lt;&amp;lt; sort( by(:NPN1), order(descending), replace table(1));

dt &amp;lt;&amp;lt; new column("minimum NPN1", set each value(
	if(col cumulative sum(1,:site) &amp;lt;= 5, 1, 0)
));

// Set the table back to the original order
dt &amp;lt;&amp;lt; sort( by(:Orig Row), order(ascending), replace table(1));
dt &amp;lt;&amp;lt; delete columns(Orig Row);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2023 22:58:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Identify-lowest-5-sequential-rows-byVar/m-p/662322#M85113</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-07-25T22:58:25Z</dc:date>
    </item>
  </channel>
</rss>

