cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

JMP Calculator

In JMP we can do calculation using the JMP calculator.
The parameters in the formula are the columns table, attached is a simple formula subtracting y column from x column with LAG,
What I want to know is if there is a way to use different lag for different rows.
((Lag( x, 2 ) - :y) / Lag( x, 2 )) * 100

Thank you
Yaakov
2 REPLIES 2
XanGregg
Staff

Re: JMP Calculator

Yes, replace the "2" in the Lag function with some expression that depends on Row(). For instance,

Lag( x, If( Row() < 10, 2, 3 ))

That uses a lag of 2 for the first 9 rows and 3 for the others.

Re: JMP Calculator

Xan,

WOW, very helpful.

I assume it is possible to put the "If" outside the formula and the "Lag" inside.
Also, I assume it is possible to make it more complex,for example many different lags for many different rows.

Thank you very much.

Sharon

Recommended Articles