<?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 identify mins of maxes across data groups in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823823#M100308</link>
    <description>&lt;P&gt;-&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2024 21:04:23 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2024-12-16T21:04:23Z</dc:date>
    <item>
      <title>How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821762#M100086</link>
      <description>&lt;P&gt;Suppose I took all the students in Big Class and put them in groups by gender and age, e.g. 12yo boys in one group, 12yo girls in another, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that setup, I'd like to create a formula column that has a 1 if that group has the shortest maximum height for their age across both genders, and a 0 otherwise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Group&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Name&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Height&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;NEW COLUMN&lt;/FONT&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;12yo Girls&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;KATIE&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;59&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;0&lt;/FONT&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;JANE&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;55&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;0&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;JACLYN&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;66&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;0&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;LILLIE&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;52&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;0&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;12yo Boys&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;TIM&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;60&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;JAMES&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;61&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ROBERT&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;51&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The maximum height for girls is 66 and for boys is 61, so the boys group has the shortest maximum height for their age, so the new formula column would have a 1 for Tim, James, and Robert, and a zero for Katie, Louise, Jane, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible in a formula column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I can share what I've tried, but I'm trying to avoid the xyproblem, &lt;A href="http://xyproblem.info" target="_blank" rel="noopener"&gt;http://xyproblem.info&lt;/A&gt; here...)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 15:30:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821762#M100086</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2024-12-10T15:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821773#M100087</link>
      <description>&lt;P&gt;You can use the Col ... aggregations.&lt;BR /&gt;&lt;BR /&gt;edit: if somebody asked for the gender with the student with smallest height per age group:&lt;BR /&gt;First use Col Min to find the student with the minimum height per age.&lt;BR /&gt;Then use Col Max to spread this knowledge among all students with the same sex.&lt;/P&gt;&lt;P&gt;so:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "myCol",
	Formula( Col Maximum( :height == Col Minimum( :height, :age ), :sex, :age ) ),
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;As you asked for&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;a formula column that has a&amp;nbsp;&lt;/SPAN&gt;1 if that group has the shortest maximum height for their age across both genders, and a 0 otherwise&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;the approach has to be corrected to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "myCol",
	Formula(
		Col Maximum(
			:height == Col Min( Col Maximum( :height, :age, :sex ), :age ),
			:sex,
			:age
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;along the idea of:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;what is the maximum height per age and gender&lt;/LI&gt;&lt;LI&gt;take the values and find the minimum (max) height per age&lt;/LI&gt;&lt;LI&gt;which student?&lt;BR /&gt;&lt;FONT face="comic sans ms,sans-serif" color="#999999"&gt;[ah, no, we don't want a random student, we just want a max height student!]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="comic sans ms,sans-serif" color="#999999"&gt;-&amp;gt; replace&amp;nbsp;&lt;CODE class=" language-jsl"&gt;:height &lt;/CODE&gt;with&amp;nbsp;&lt;CODE class=" language-jsl"&gt;Col Maximum( :height, :age, :sex ) *)&lt;/CODE&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRIKE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;use col max to spread the 1 to all other students with the same sex and age&lt;/STRIKE&gt;&lt;BR /&gt;&lt;STRIKE&gt;set the other gender to 0 - or 1, if there is a boy and a girl with the same height.&lt;/STRIKE&gt;&lt;BR /&gt;&lt;FONT face="comic sans ms,sans-serif" color="#999999"&gt;this part we don't need anymore&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="comic sans ms,sans-serif" color="#999999"&gt;... and we ended up exactly with Jarmo's solution (see below)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 10 Dec 2024 21:29:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821773#M100087</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-10T21:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821774#M100088</link>
      <description>&lt;P&gt;X-Y problem :&lt;BR /&gt;thanks : )&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 15:56:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821774#M100088</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-10T15:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821776#M100090</link>
      <description>&lt;P&gt;Wow, that seems to work, but my brain cannot even fathom how this works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me try to unpack it here and maybe you can help me understand --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting with:&amp;nbsp; Col Maximum( :height == Col Minimum( :height, :age ), :sex, :age )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Col Minimum( :height, :age ) --&amp;gt; returns the minimum height for all students of this age&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;:height == Col Minimum( :height, :age ) --&amp;gt; returns true/false (1/0) if this row's height column matches that minimum height&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Col Maximum(&amp;nbsp; &amp;lt;1 or 0 for this row&amp;gt; , :sex, :age ) --&amp;gt; uh...&amp;nbsp; this makes no sense, I thought column maximum works by grouping the data by the group-by columns (:sex, :age), and then finds the column maximum of the values or column in the first argument -- which now is just a single true/false or 1/0 -- and then returns the corresponding max value for this row's group, i.e. this row's values for :sex and :age.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously that's wrong, what am I missing here?&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>Tue, 10 Dec 2024 16:28:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821776#M100090</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2024-12-10T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821779#M100092</link>
      <description>&lt;P&gt;Many ways of doing this using for example different combinations of col statistical functions (like already shown). Here other option (I think it should do what you are looking for)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Min(Col Max(:height, :age, :sex), :age) == Col Max(:height, :age, :sex)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;First Col Min() looks for the Col Max() across the age, sex groups OVER &lt;STRONG&gt;age&lt;/STRONG&gt; and that is then compared to &lt;STRONG&gt;age,sex&lt;/STRONG&gt; group maximums and if it is same as the &lt;STRONG&gt;age&lt;/STRONG&gt; groups minimum -&amp;gt; value is 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To understand these easier, I think it is beneficial to just write them all out as separate ones and to make them easier to understand, in this case:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;First column with &lt;CODE class=" language-jsl"&gt;Col Max(:height, :age, :sex)&lt;/CODE&gt; (max_height_for_agesex)&lt;/LI&gt;
&lt;LI&gt;Next column then utilizes that &lt;CODE class=" language-jsl"&gt;Col Min(:max_height_for_agesex, :age)&lt;/CODE&gt; age_minmax_age&lt;/LI&gt;
&lt;LI&gt;And the final one is the comparison of these two &lt;CODE class=" language-jsl"&gt;:max_height_for_agesex ==&amp;nbsp;:age_minmax_age&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1733849869132.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71014i4DA7FD96E4CEA468/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1733849869132.png" alt="jthi_0-1733849869132.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 16:58:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/821779#M100092</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-10T16:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822419#M100204</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; -- I'm still confused though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting with this:&lt;/P&gt;&lt;LI-CODE lang="jsl"&gt;Col Min(Col Max(:height, :age, :sex), :age) == Col Max(:height, :age, :sex)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When JMP evaluates the "Col Max(:height, :age, :sex)", what does it return?&amp;nbsp; A single value?&amp;nbsp; or a list?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create a new column with that as the formula and it produces a list of values that end up in the rows of the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But within a formula, it seems to be returning a single value, e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = col max(:height, :name);
type(a);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... returns "Number".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if I create a new script and enter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = col max(:height, :name);&amp;nbsp;&lt;BR /&gt;show(a);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;it says "invalid row number", but without the ", :name" it works fine returning 70.&amp;nbsp; It seems like JMP is doing some kind of context-specific meaning with these functions.&amp;nbsp; How does this work?&amp;nbsp; Is it explained anywhere?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 22:52:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822419#M100204</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2024-12-12T22:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822420#M100205</link>
      <description>&lt;P&gt;when you run the formula of a formula column in a cell, it calculates the value for the current row.&lt;BR /&gt;When you run it in JSL, it calculates it for the current row.&lt;BR /&gt;&lt;BR /&gt;Sounds the same. But the default value for "current row" is "row 0" - i.e. no valid numbers.&lt;BR /&gt;&lt;BR /&gt;You can also check the calculation for any row&amp;nbsp; - different from the default "0".&lt;BR /&gt;Just put a &lt;FONT face="courier new,courier"&gt;row()=xy&lt;/FONT&gt; in front of your calculation and the calculation will be done for row &lt;FONT face="courier new,courier"&gt;xy&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;so, e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;row()=5;	
col max(:height, :age)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will return 66.&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;:age&lt;/FONT&gt; in &lt;FONT face="courier new,courier"&gt;row=5&lt;/FONT&gt; is &lt;FONT face="courier new,courier"&gt;12&amp;nbsp;&lt;/FONT&gt;and&amp;nbsp; the maximum height for &lt;FONT face="courier new,courier"&gt;age =12&lt;/FONT&gt; is &lt;FONT face="courier new,courier"&gt;66&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 22:59:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822420#M100205</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-12T22:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822421#M100206</link>
      <description>&lt;P&gt;I guess it works like this:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Col ...&lt;/FONT&gt; first runs through all the rows and stores the results of the first argument.&lt;BR /&gt;It calculates it row by row - e.g. if the first argument is &lt;FONT face="courier new,courier"&gt;random uniform()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;In addition, it stores a lookup table for the additional group by arguments.&lt;BR /&gt;Then it splits the data into subsets, calculates the aggregated values - and then it distributes the aggregated values back into the respective rows.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 23:03:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822421#M100206</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-12T23:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822448#M100215</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;When JMP evaluates the "Col Max(:height, :age, :sex)", what does it return?&amp;nbsp; A single value?&amp;nbsp; or a list?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Single value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you create a script and wish to test what is going on, you have to utilize Row() IF you are using by columns (without by columns it will work as JMP knows to use all rows). Row() will be 0 by default in JMP, so you have to change it for example to Row() = 1. I think I have seen some documentation about this in JMP Help or scripting index, but no idea where (could be related to Row(), For Each Row or Col statistical functions).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

max_height = Col Max(:height); // works fine as no by var used and uses all rows

Show(Row());
Col Max(:height, :age); // won't work as JMP doesn't know which age to use -&amp;gt; it needs row information

Row() = 1;
cur_age = :age;
cur_maxheight = Col Max(:height, :age);
Write("\!Max height for age ", cur_age, " is ", cur_maxheight);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2024 05:51:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/822448#M100215</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-13T05:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823802#M100301</link>
      <description>&lt;P&gt;It sounds like you're saying that JMP is wrapping the entire column-formula in a loop that iterates "Row()" over the rows of the table, calculating a value for each row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That *would* make sense, except for this expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Min(Col Max(:height, :age, :sex), :age)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... which by that logic, when e.g. Row() is set to i=1, then it would calculate Col Max() as the largest value in the :height column of the whole table where :age[i] == :age[1] and :sex[i] == :sex[1], which returns a single number.&amp;nbsp; Then it tries to calculate Col Min() of that single number, which by definition can only ever be that number.&amp;nbsp; I'm really struggling to make that make sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep thinking that Col Max() must be returning a list, then the Col Min() could be looking at all the rows of that list where :age[i] == :age[1].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my idea here requires that JMP do something similar to what perl does, basically keeping track of whether something is being called in scalar or list context, i.e. if a function is used in a way that expects a list back, it returns a list, otherwise it returns a scalar.&amp;nbsp; That way Col Max() here could return a list for Col Min(), which in turn would return a scalar value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm guessing I'm missing something here and can't put my finger on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 19:21:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823802#M100301</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2024-12-16T19:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823804#M100303</link>
      <description>&lt;P&gt;No, the idea is NOT that JMP goes ONCE row by row through the table and calculates the whole expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 19:47:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823804#M100303</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-16T19:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823806#M100304</link>
      <description>&lt;P&gt;To investigate what JMP is doing, let's first create a very small data table ...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt0 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = dt0 &amp;lt;&amp;lt; Clear Select &amp;lt;&amp;lt; Select Rows( [2, 10, 11, 25] ) &amp;lt;&amp;lt; Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
nr = n rows(current data table());&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... and a formula column with some log functionality:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "test", Formula(Col Min(Write( "\!nmin:" || (Char( Row() )) );if(row()==nr, write("\!n") );:height, :age)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1734378824971.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71276iC50AA93CEE995891/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1734378824971.png" alt="hogi_0-1734378824971.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, for this case, JMP runs the code several times.&lt;BR /&gt;Let's wonder later ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 20:31:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823806#M100304</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-16T20:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823818#M100306</link>
      <description>&lt;P&gt;Let's now check with&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "test",
	Formula(
		Col Min(
			Write( "\!nmin:" || (Char( Row() ) || "\!n\!n") );
			Col Max(
				Write( "max:" || (Char( Row() ) || "\!n") );
				:height;,
				:age,
				:sex
			);,
			:age
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... and we get *)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1734378993152.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71277iE9C3A529E26884DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1734378993152.png" alt="hogi_1-1734378993152.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;which shows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;for the simple example JMP evaluates the &lt;STRONG&gt;first argument&lt;/STRONG&gt;&amp;nbsp;of &lt;FONT face="courier new,courier"&gt;Col Min&lt;/FONT&gt; for every row&lt;/LI&gt;&lt;LI&gt;for the second version, JMP evaluates the &lt;STRONG&gt;first argument&lt;/STRONG&gt;&amp;nbsp;of &lt;FONT face="courier new,courier"&gt;Col Min&lt;/FONT&gt; for every row&amp;nbsp;- and as there is another &lt;FONT face="courier new,courier"&gt;Col...&lt;/FONT&gt; aggregation inside this code, this is followed by the &lt;FONT face="courier new,courier"&gt;ColMax&lt;/FONT&gt; loop: first argument of &lt;FONT face="courier new,courier"&gt;Col Max&lt;/FONT&gt; for every row&lt;BR /&gt;At the end, JMP knows the value of&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ColMax(...) &lt;/FONT&gt;for every single row, and can then evaluate &lt;FONT face="courier new,courier"&gt;Col min&lt;/FONT&gt; with these values.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is more or less what you say - with the list context. But I think JMP stores the results in data table context. Such that it can combine the VALUES with additional information like &lt;FONT face="courier new,courier"&gt;row(), row states() ..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but&amp;nbsp;&amp;nbsp;somebody from JMP - or&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; - might explain better ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*) again: multiple times:&lt;BR /&gt;further details can be found here:&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Statistical-functions-Col-Mean-for-example-possibly-bugged-on/m-p/613887/highlight/true#M81398" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Statistical-functions-Col-Mean-for-example-possibly-bugged-on/m-p/613887/highlight/true#M81398&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 20:13:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823818#M100306</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-16T20:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823820#M100307</link>
      <description>&lt;P&gt;another way to test the execution of the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;i = 0;
j = 0;
New Column( "test",
	Formula(
		Col Min(
			i++;
			Col Max(
				j++;
				:height;,
				:age,
				:sex
			);,
			:age
		)
	)
);
// too early
Show( i );
Show( j );
Current Data Table() &amp;lt;&amp;lt; run formulas();
// after calculating the values
Show( i );
Show( j );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1734381004188.png" style="width: 84px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71279i92AEF221A6E7E1E4/image-dimensions/84x97?v=v2" width="84" height="97" role="button" title="hogi_1-1734381004188.png" alt="hogi_1-1734381004188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i = 5 x 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [(nr+1) * nr]&lt;/P&gt;&lt;P&gt;j = 5 x 5 x 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;[(nr+1) * (nr+1) * nr]&lt;BR /&gt;&lt;BR /&gt;the access to the global variables i &amp;amp; j seems to be as bad as&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/How-do-I-use-the-Col-Maximum-Formula-with-a-quot-where-quot/m-p/578576/highlight/true#M78599" target="_blank"&gt;https://community.jmp.com/t5/Discussions/How-do-I-use-the-Col-Maximum-Formula-with-a-quot-where-quot/m-p/578576/highlight/true#M78599&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Statistical-functions-Col-Mean-for-example-possibly-bugged-on/m-p/613978/highlight/true#M81407" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Statistical-functions-Col-Mean-for-example-possibly-bugged-on/m-p/613978/highlight/true#M81407&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for the performance of &lt;FONT face="courier new,courier"&gt;Col ...&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 20:39:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823820#M100307</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-16T20:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823823#M100308</link>
      <description>&lt;P&gt;-&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 21:04:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823823#M100308</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-16T21:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823824#M100309</link>
      <description>&lt;P&gt;Col statistical functions do have their own magic which some other functions do not, for example they have internal caching and support byvars.&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/statistical-functions.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/statistical-functions.shtml#&lt;/A&gt;&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 20:52:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823824#M100309</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-16T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823828#M100312</link>
      <description>&lt;P&gt;Yes, this clever way of preparing the data i extremely helpful:&lt;BR /&gt;examples of how the magic works:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Clear Select &amp;lt;&amp;lt; Select Rows( Index( 5, 40 ) ) &amp;lt;&amp;lt;Delete Rows;
newCol=New Column("new");
newCol &amp;lt;&amp;lt; Set each value(Col Min(Print(row());:height,:age)); // 4 rows&lt;BR /&gt;newCol &amp;lt;&amp;lt; Set Formula(Col Min(Print(row());:height,:age)); // 2 x 4&lt;BR /&gt;&lt;BR /&gt;newCol &amp;lt;&amp;lt; Set each value(Col Min(Col Max(Print(row());:height,:sex),:age)); // 4  + 4 
newCol &amp;lt;&amp;lt; Set Formula(Col Min(Col Max(Print(row());:height,:sex),:age)); // 2 x 4  + 4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please make sure that you don't run into one of these taps:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;i=1;&lt;BR /&gt;newCol &amp;lt;&amp;lt; set each value (Col Min(Print("X");:height,:age)); // 16 = 4 x 4 
newCol &amp;lt;&amp;lt; set Formula (Col Min(Print("X");:height,:age)); // 20 = 5 x 4&lt;BR /&gt;newCol &amp;lt;&amp;lt; set Formula (Col Min("x";Print(3);:height,:age)); // 20 = 5 x 4
newCol &amp;lt;&amp;lt; Set Formula(Col Min(i;Print(row());:height,:age)); // 20 = 5 x 4&lt;BR /&gt;
newCol &amp;lt;&amp;lt; set each value (Col Min(Col Max(Print("X");:height,:sex),:age)); // 80 = 5 x 4 x 4 
newCol &amp;lt;&amp;lt; set Formula (Col Min(Col Max(Print("X");:height,:sex),:age)); // 100 = 5 x 5 x 4&lt;BR /&gt;newCol &amp;lt;&amp;lt; set Formula (Col Min(Col Max("X";Print(3);:height,:sex),:age)); // 100 = 5 x 5 x 4
newCol &amp;lt;&amp;lt; Set Formula(Col Min(Col Max(i;Print(row());:height,:sex),:age)); // 100 = 5 x 5 x 4&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Col aggregations get cautious when they see&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;strings&lt;/LI&gt;&lt;LI&gt;variables&lt;/LI&gt;&lt;LI&gt;?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;then they switch to a reduced speed and calculate every value for every row (+1) ... in a hierarchical tree.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 07:27:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/823828#M100312</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-17T07:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/824547#M100413</link>
      <description>&lt;P&gt;Not sure I'm smart enough to follow everything you're doing here --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It sounds like you're agreeing with me?&amp;nbsp; I.e. that Col ... functions do different things in scalar vs. list contexts?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 21:08:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/824547#M100413</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2024-12-19T21:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify mins of maxes across data groups</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/824696#M100442</link>
      <description>&lt;P&gt;Let's wait a year and discuss again - things could change.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 16:18:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-identify-mins-of-maxes-across-data-groups/m-p/824696#M100442</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-20T16:18:22Z</dc:date>
    </item>
  </channel>
</rss>

