turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- entering the last value of a list

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 29, 2016 9:12 AM
(3743 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 29, 2016 10:09 AM
(6303 views)
| Posted in reply to message from danielharding0 11/29/2016 12:12 PM

`x[nrows(x)];`

That should do it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 30, 2016 12:46 PM
(6274 views)
| Posted in reply to message from danielharding0 11/29/2016 12:12 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 29, 2016 10:09 AM
(6304 views)
| Posted in reply to message from danielharding0 11/29/2016 12:12 PM

`x[nrows(x)];`

That should do it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 30, 2016 12:46 PM
(6275 views)
| Posted in reply to message from danielharding0 11/29/2016 12:12 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

works great. Thanks