cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
zathe
Level I

How to evaluate a column bottom to top?

I need to count negative indexes from a particular cell, how you make a single column evaluate bottom to top?

 

Col 29    Col 31

0            -5

0            -4

0            -3

0            -2

0            -1

1            -42

1            -41

1            -40

 

If( Lag( :Column 29, -1 ) == 1 & :Column 29 == 0,
-1,
Lag( :Column 31, -1 ) - 1
)
2 REPLIES 2
jthi
Super User

Re: How to evaluate a column bottom to top?

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

Col Cumulative Sum(1, :Column 1) - 1 - Col Number(:Column 1, :Column 1)

jthi_0-1712848341751.png

 

-Jarmo
txnelson
Super User

Re: How to evaluate a column bottom to top?

Jarmo has a strong possible way of solving the issue.  I have taken a longer route, which demonstrates one way of working backwards.  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.  In this section, it loops from the last row to the first row and creates a result matrix called "Values".  Then in the actual formula, the only thing to do is to apply the value from the Values matrix to each of the rows.

As Constant(
	values = J( 1, N Rows( Current Data Table() ), . );
	For( i = Length( values ) - 1, i >= 1, i--,
		if(:col 29[i] == 0 & :Col 29[i + 1] == 1,
		values[i]=1,
		:col 29[i] == 0 & :Col 29[i + 1] == 0,
		values[i] = values[i-1]-1,
		values[i]=.
	));
	Show( values );
);
values[Row()];

txnelson_0-1712849604220.png

 

Jim

Recommended Articles