- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
subtract cells from different rows
is there a way to do this calculation in JMP?
i would like to subtract cell 1 from cell 2 and place the result in a new column, cell3 from cell4, and so on.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: subtract cells from different rows
You can use Lag() to access values from other rows of a column. Then you can create a formula using Lag between those two columns you have
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("S", Numeric, Continuous, Formula(
Lag(:weight) - :height
));
-Jarmo
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: subtract cells from different rows
You can use Lag() to access values from other rows of a column. Then you can create a formula using Lag between those two columns you have
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("S", Numeric, Continuous, Formula(
Lag(:weight) - :height
));
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: subtract cells from different rows
it works great. Thank you so much