Subscribe Bookmark RSS Feed

If statement for most recent sample

jsurette

Community Trekker

Joined:

Jun 23, 2011

Hi,

I'm trying to create an IF statement for the following scenario:

26 weeks of data.
2 data columns (a & b).

For the most recent week, (if a > b, "More", "Less")

Simple enough, except that I'd like to label all rows with the result from the most recent week. For example, if b > a for all of the rows except the recent week, I'd like all of the rows to show "More", as the most recent week is a > b. Is there a way to do this in JMP?

Thanks!
Josh
2 REPLIES
mewing

Community Trekker

Joined:

Jun 23, 2011

I can't verify this 100%, but you ought to be able to do something along the lines of:

n = NRow(); //or 26 if it's always 26
if(:a > :b,"More","Less");

or, if not that, Row(n) should reference the last row.
jsurette

Community Trekker

Joined:

Jun 23, 2011

Thanks! That worked perfectly.

Really appreciate the help!
Josh