<?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 you write a column formula which can group by rows defined by another column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899155#M105902</link>
    <description>&lt;P&gt;Here are few examples using my example table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Column 4:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:C[Col Min(If(:R &amp;lt;= 60, Row(), .), :G)]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your data is always in order (by Cycle and Retention) and Retention always reaches 60, using :C[] could be unnecessary and you could calculate the row in "reverse" by calculating how many items are above 60, Column 5:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Sum(:R &amp;gt; 60, :G) + 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1757347794849.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/82079i17A2D657B8D0E969/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1757347794849.png" alt="jthi_1-1757347794849.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: You could also combine Col Min and Col Number&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;m = Col Sum(:R &amp;lt;= 60, :G);
If(m &amp;gt; 0,
	Col Number(:G, :G) - m + 1;
,
	.
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 08 Sep 2025 16:17:59 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-09-08T16:17:59Z</dc:date>
    <item>
      <title>How do you write a column formula which can group by rows defined by another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899139#M105900</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would like to be able to write column formulae which can perform various column formula functions within groups defined by rows in, for example, a column called 'group'. There are various mentions of the 'group by' button when using gemini, but I cannot find this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, I would like to calculate the first cycle in the below table when the retention first passes 60 % (cycle where retention &amp;lt;= 60 %) for each group, A, B, and C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I go about doing this? Thanks for the help :)&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My JMP version is JMP18 .&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="LauraW_2-1757346064123.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/82075i250E791BACED5514/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LauraW_2-1757346064123.png" alt="LauraW_2-1757346064123.png" /&gt;&lt;/span&gt;&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>Mon, 08 Sep 2025 15:43:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899139#M105900</guid>
      <dc:creator>LauraW</dc:creator>
      <dc:date>2025-09-08T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you write a column formula which can group by rows defined by another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899153#M105901</link>
      <description>&lt;P&gt;Here's what I came up with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;g = :Group[Row()];
Min( :Cycle[Where( :Group == g &amp;amp; :Retention &amp;lt;= 60 )] );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Sep 2025 16:08:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899153#M105901</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2025-09-08T16:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you write a column formula which can group by rows defined by another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899155#M105902</link>
      <description>&lt;P&gt;Here are few examples using my example table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Column 4:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:C[Col Min(If(:R &amp;lt;= 60, Row(), .), :G)]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your data is always in order (by Cycle and Retention) and Retention always reaches 60, using :C[] could be unnecessary and you could calculate the row in "reverse" by calculating how many items are above 60, Column 5:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Sum(:R &amp;gt; 60, :G) + 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1757347794849.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/82079i17A2D657B8D0E969/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1757347794849.png" alt="jthi_1-1757347794849.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: You could also combine Col Min and Col Number&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;m = Col Sum(:R &amp;lt;= 60, :G);
If(m &amp;gt; 0,
	Col Number(:G, :G) - m + 1;
,
	.
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Sep 2025 16:17:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-you-write-a-column-formula-which-can-group-by-rows/m-p/899155#M105902</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-08T16:17:59Z</dc:date>
    </item>
  </channel>
</rss>

