cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

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

Row difference (moving range)

Hello,

 


Can you help how to write a formula for row difference? My problem with the formula is that I have a variable column "Partnumber" and I don't want the row difference calculated if the next row has a different partnumber than the current row. Please find a sample table. In row number 30, the part number is different than the previous row. For row 30, I don't want the calculation but then continue as long as the next rows
 have the same part number as row 30 and so on.

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Row difference (moving range)

I think an if statement will do what you want, see the column formula below.  This will return zero for row 30, you might prefer a missing value.

 

If( :Epi_Product_Number == Lag( :Epi_Product_Number, 1 ),
	Dif( :"Mean(Average)"n ),
	0
)
Sebnem
Level II

Re: Row difference (moving range)

thank you very much. It worked very well.

Recommended Articles