cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Due to the recently reported Microsoft outage, users may be temporarily unable to access My JMP or experience a delay receiving their verification codes. If you have previously installed JMP on your computer, this outage should not impact your ability to access the software. My JMP services will be restored as soon as Microsoft resolves this issue.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

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 VII

Re: Checking if value of a row is consecutive

Awesome! Thanks Jarmo!

Recommended Articles