cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Jackie_
Level VI

Checking if value of a row is consecutive

Hi JMP Community,

 

I want to check if the values of a row are consecutive and if it not then get the value of the first row which doesn't satisfy the condition.

 

For example : In this table, Column 1 has rows 1 to 15 that have consecutive values 1,2,3 and then row 16 has value of 12. So I would like to get the value of that first row that doesn't satisfy the consecutive condition.

 

Is there a more jsl way than using an iterator? 

Jackie__1-1686755738953.png

 

 

Thanks, 
Jackie

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Checking if value of a row is consecutive

One option would be to use Lag() or Dif() with Get Rows Where()

first_nok = Min(dt << Get Rows Where(Dif(:Column 1) > 1));
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Checking if value of a row is consecutive

One option would be to use Lag() or Dif() with Get Rows Where()

first_nok = Min(dt << Get Rows Where(Dif(:Column 1) > 1));
-Jarmo
Jackie_
Level VI

Re: Checking if value of a row is consecutive

Awesome! Thanks Jarmo!