<?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 classify group based on count in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276866#M53772</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/19545"&gt;@tantaibi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I'd use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Row() == 1, 1,
	:Count &amp;gt;= Lag( :Count, 1 ), Lag( :Name( "Cycle (My Formula)" ), 1 ),
	Lag( :Name( "Cycle (My Formula)" ), 1 ) + 1
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 675px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25077iF1C89AF1E2E9658D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note Lag(col, 1) is the previous row's value in "col".&amp;nbsp; I added the equal to case. to be in the previous (same) group.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Jul 2020 11:54:03 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2020-07-04T11:54:03Z</dc:date>
    <item>
      <title>How do I classify group based on count</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276863#M53771</link>
      <description>&lt;P&gt;Hi JMP community folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data table with four columns as Side, TIME, Count, and ID.&lt;/P&gt;
&lt;P&gt;I am trying to add a new column that groups a batch of IDs based on the Count column.&lt;/P&gt;
&lt;P&gt;The data has already been sorted by Time and Count.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The desired output I am trying to achieve is in the "Cycle (desired output)" column.&lt;/P&gt;
&lt;P&gt;The formula which I tried to use was lag. But I am not able to achieve the desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :Count &amp;lt; Lag( :Count, -1 ),
    i,
    i + 1
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would anyone have any solutions to this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:15:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276863#M53771</guid>
      <dc:creator>tantaibi</dc:creator>
      <dc:date>2023-06-10T23:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I classify group based on count</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276866#M53772</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/19545"&gt;@tantaibi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I'd use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Row() == 1, 1,
	:Count &amp;gt;= Lag( :Count, 1 ), Lag( :Name( "Cycle (My Formula)" ), 1 ),
	Lag( :Name( "Cycle (My Formula)" ), 1 ) + 1
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 675px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25077iF1C89AF1E2E9658D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note Lag(col, 1) is the previous row's value in "col".&amp;nbsp; I added the equal to case. to be in the previous (same) group.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 11:54:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276866#M53772</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-07-04T11:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I classify group based on count</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276873#M53776</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the explanation!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if there were 2 sides, Side A and SIde B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I "restart" the cycle count for Side B to "1"?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of letting it continue to "5" onwards?&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="tantaibi_0-1593872596552.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25080i85CBCAC1E6CC2A01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tantaibi_0-1593872596552.png" alt="tantaibi_0-1593872596552.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to used a condition formatting for Side A and Side B, but not sure how to define a different formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 14:24:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276873#M53776</guid>
      <dc:creator>tantaibi</dc:creator>
      <dc:date>2020-07-04T14:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I classify group based on count</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276885#M53783</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 871px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25083i5FDED7506EC5C2D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&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="image.png" style="width: 244px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25084iE3EA642A9DB589C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will work for multiple levels of Side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Row() == 1, 1,
	:Side == Lag( :Side, 1 ) &amp;amp; :Count &amp;gt;= Lag( :Count, 1 ), Lag( :Name( "Cycle(My Formula)" ), 1 ),
	:Side == Lag( :Side, 1 ), Lag( :Name( "Cycle(My Formula)" ), 1 ) + 1,
	1
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Jul 2020 03:50:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-classify-group-based-on-count/m-p/276885#M53783</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-07-05T03:50:42Z</dc:date>
    </item>
  </channel>
</rss>

