Subscribe Bookmark RSS Feed

First and Last SAS Functionality in JMP

garyb

Community Member

Joined:

Sep 6, 2012

Does JMP have first and last functionality similar to that in SAS?

e.g.

if first.variablename then

....;

if last.variablename then
....;

2 REPLIES
XanGregg

Staff

Joined:

Jun 23, 2011

I'm not familiar with the constructs, but from a quick search I gather you want to if the current row contains the first or last occurrence of a particular variable's value in a data set sorted by that variable. I think that would be:

if (:var != Lag(:var), ...); // first

if (:var != Lag(:var, -1), ...); // last

tom

Community Trekker

Joined:

Jul 9, 2011

Wouldn't the equivalent in a matrix language just be indexing to the first value or the last value?