cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar

entering the last value of a list

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

Re: entering the last value of a list

x[nrows(x)];

That should do it.

View solution in original post

hlrauch
Level III

Re: entering the last value of a list

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 )];

View solution in original post

3 REPLIES 3
pmroz
Super User

Re: entering the last value of a list

x[nrows(x)];

That should do it.

hlrauch
Level III

Re: entering the last value of a list

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 )];

Re: entering the last value of a list

works great. Thanks