<?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 do I iterate through rows to find most common and max values? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37699#M22100</link>
    <description>&lt;P&gt;Hi Lou -&lt;/P&gt;&lt;P&gt;Thanks for the quick response! My goal is to have an output table with one row per unique entitry from Field 1 with corresponding most frequent Field 2 and Max value... It's essentially a data consolidation problem where I need to filter down to concise dataset with no repeated rows...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 20:36:36 GMT</pubDate>
    <dc:creator>chrisATX1</dc:creator>
    <dc:date>2017-03-30T20:36:36Z</dc:date>
    <item>
      <title>How do I iterate through rows to find most common and max values?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37693#M22097</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a table with multiple rows for a given identifier, and I would like to find the most common rows and max values of associated rows. The example below should help illustrate what I am trying to do:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Sample Table.JPG" style="width: 280px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5756i6074A11467DB695D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sample Table.JPG" alt="Sample Table.JPG" /&gt;&lt;/span&gt;The most common Field 2 value corresponding to the value of "CC" in Field 1 is "MG" and the maximum value from the "Value" field is&amp;nbsp;220,264,000,000. &amp;nbsp;I think I need to use the "lag" function to iterate through the rows corresponding to each of the unique values in Field 1, but have not been able to get both the most common Field 2 and Max Value with the same bit of JSL code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips are much appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:23:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37693#M22097</guid>
      <dc:creator>chrisATX1</dc:creator>
      <dc:date>2023-06-09T23:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through rows to find most common and max values?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37697#M22099</link>
      <description>&lt;P&gt;Not sure if this helps but I used Tables&amp;gt;Summary and then used Field&amp;nbsp;1 and Field&amp;nbsp;2 as Grouping variable and Max as the statistic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-03-30 at 4.11.32 PM.png" style="width: 585px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5758iB06DC1C677A0B58A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-03-30 at 4.11.32 PM.png" alt="Screen Shot 2017-03-30 at 4.11.32 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 20:14:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37697#M22099</guid>
      <dc:creator>louv</dc:creator>
      <dc:date>2017-03-30T20:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through rows to find most common and max values?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37699#M22100</link>
      <description>&lt;P&gt;Hi Lou -&lt;/P&gt;&lt;P&gt;Thanks for the quick response! My goal is to have an output table with one row per unique entitry from Field 1 with corresponding most frequent Field 2 and Max value... It's essentially a data consolidation problem where I need to filter down to concise dataset with no repeated rows...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 20:36:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37699#M22100</guid>
      <dc:creator>chrisATX1</dc:creator>
      <dc:date>2017-03-30T20:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through rows to find most common and max values?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37700#M22101</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;
&lt;P&gt;perhaps this two step&amp;nbsp;approach cant help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt2 = Data Table( "Sample Data Table" ) &amp;lt;&amp;lt; Summary( Group( :Field 1, :Field 2 ), Max( :Value ) );

todelete = dt2 &amp;lt;&amp;lt; get rows where (:N Rows != colmax(:N Rows, :Field 1));&lt;BR /&gt;dt2 &amp;lt;&amp;lt; delete rows (todelete);&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it first does what Lou suggests and then cleans the non max combinations to achieve the final result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 21:44:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37700#M22101</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2017-03-30T21:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through rows to find most common and max values?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37754#M22131</link>
      <description>&lt;P&gt;Hi Ron -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! &amp;nbsp;This works perfectly - appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 23:07:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-iterate-through-rows-to-find-most-common-and-max-values/m-p/37754#M22131</guid>
      <dc:creator>chrisATX1</dc:creator>
      <dc:date>2017-03-31T23:07:12Z</dc:date>
    </item>
  </channel>
</rss>

