<?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 evaluate a column bottom to top? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746883#M92598</link>
    <description>&lt;P&gt;Based on your example data, you might be able to use group of your first column and then use count of items in that group and cumulative sum&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Cumulative Sum(1, :Column 1) - 1 - Col Number(:Column 1, :Column 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_0-1712848341751.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63266i30399F924C50180C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1712848341751.png" alt="jthi_0-1712848341751.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 15:12:56 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-04-11T15:12:56Z</dc:date>
    <item>
      <title>How to evaluate a column bottom to top?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746864#M92594</link>
      <description>&lt;P&gt;I need to count negative indexes from a particular cell, how you make a single column evaluate bottom to top?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Col 29&amp;nbsp; &amp;nbsp; Col 31&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -5&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -4&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -3&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -2&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -42&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -41&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -40&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Lag( :Column 29, -1 ) == 1 &amp;amp; :Column 29 == 0,
-1,
Lag( :Column 31, -1 ) - 1
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2024 13:34:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746864#M92594</guid>
      <dc:creator>zathe</dc:creator>
      <dc:date>2024-04-11T13:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate a column bottom to top?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746883#M92598</link>
      <description>&lt;P&gt;Based on your example data, you might be able to use group of your first column and then use count of items in that group and cumulative sum&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Cumulative Sum(1, :Column 1) - 1 - Col Number(:Column 1, :Column 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_0-1712848341751.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63266i30399F924C50180C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1712848341751.png" alt="jthi_0-1712848341751.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 15:12:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746883#M92598</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-11T15:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to evaluate a column bottom to top?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746896#M92604</link>
      <description>&lt;P&gt;Jarmo has a strong possible way of solving the issue.&amp;nbsp; I have taken a longer route, which demonstrates one way of working backwards.&amp;nbsp; The approach does all of the work just as the formula starts processing by using an As Constant() function, which runs the contained code once.&amp;nbsp; In this section, it loops from the last row to the first row and creates a result matrix called "Values".&amp;nbsp; Then in the actual formula, the only thing to do is to apply the value from the Values matrix to each of the rows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(
	values = J( 1, N Rows( Current Data Table() ), . );
	For( i = Length( values ) - 1, i &amp;gt;= 1, i--,
		if(:col 29[i] == 0 &amp;amp; :Col 29[i + 1] == 1,
		values[i]=1,
		:col 29[i] == 0 &amp;amp; :Col 29[i + 1] == 0,
		values[i] = values[i-1]-1,
		values[i]=.
	));
	Show( values );
);
values[Row()];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1712849604220.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63273iE44DBA9BFD5531A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1712849604220.png" alt="txnelson_0-1712849604220.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 15:33:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-evaluate-a-column-bottom-to-top/m-p/746896#M92604</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-11T15:33:39Z</dc:date>
    </item>
  </channel>
</rss>

