cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

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

例如按身高的数值大于63的堆数:

 

这个堆数是指:当相邻行数连续大于63时计数为1、这样计数应该是有 8 

这个用循环的方式能得到结果、请教是否还有其它方式可以得到结果。谢谢!

 

2021-12-02_154024.png

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 IX

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

当数据量很大时、两个专家的方法耗时方面是有较大差异的。再次感谢!

Recommended Articles