turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- JMP Calculator

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 11, 2009 2:23 AM
(1227 views)

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 11, 2009 8:56 AM
(1195 views)

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.

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Mar 12, 2009 12:30 AM
(1195 views)

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

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