Subscribe Bookmark RSS Feed

entering the last value of a list

danielharding0

Community Trekker

Joined:

May 16, 2016

I'm attempting to get the last value from a list that was created using the following:

x = :Values << get values;

 

I tried using x[n rows()] since I know that works with the get as matrix() function, but the list is nominal and I keep getting an error.

 

Any help is appreciated. I'm using JMP 11

2 ACCEPTED SOLUTIONS

Accepted Solutions
pmroz

Super User

Joined:

Jun 23, 2011

Solution
x[nrows(x)];

That should do it.

hlrauch

Community Trekker

Joined:

Sep 19, 2014

Solution

If the data type of the Values column is "Character" (and therefore the modeling type of the Values column is either nominal or ordinal), then x is a list instead of a matrix. (Values in a list is enclosed in curly braces {} instead of brackets [] ). In that case try using the N Items() function instead of the N Rows() function.

 

lastitem = x[N Items( x )];

3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Solution
x[nrows(x)];

That should do it.

hlrauch

Community Trekker

Joined:

Sep 19, 2014

Solution

If the data type of the Values column is "Character" (and therefore the modeling type of the Values column is either nominal or ordinal), then x is a list instead of a matrix. (Values in a list is enclosed in curly braces {} instead of brackets [] ). In that case try using the N Items() function instead of the N Rows() function.

 

lastitem = x[N Items( x )];

danielharding0

Community Trekker

Joined:

May 16, 2016

works great. Thanks