cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

How can I find the result without looping?

lala
Level VIII

For example, the number of piles according to the height value greater than 63:

 

This heap number refers to: when the number of adjacent rows is more than 63 consecutively, the count is 1, so the count should be 8.

The result can be obtained in a circular way, please ask if there are other ways to get the result. Thanks!

 

undefined

This post originally written in Chinese (Simplified) and has been translated for your convenience. When you reply, it will also be translated back to Chinese (Simplified).

3 REPLIES 3
jthi
Super User


Re: 如何能不用循环的方式求出结果?

Maybe something like this:

If(Row() == 1, cur_val = 1);
If(:height > 63 & Lag(:height) <= 63,
	cur_val
	++);
-Jarmo
lwx228
Level VIII

Re: 如何能不用循环的方式求出结果?

Sum(:height[Index(1,Row()-1)]<=63&:height[Index(2,Row())]>63)
lala
Level VIII

Re: How can I get the result without looping?

When the amount of data is large, the time-consuming methods of the two experts are quite different. Thanks again!

This post originally written in Chinese (Simplified) and has been translated for your convenience. When you reply, it will also be translated back to Chinese (Simplified).