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

Showing results for

- JMP User Community
- :
- Discussions
- :
- How to use '<< Select Where' or '<< Get Rows Where...

- 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

Apr 29, 2015 6:43 AM
(1099 views)

Hi,

Basically, I have script where I'm trying to return the row numbers of certain columns that contain a specific value. In my example, I have several columns where the value can either be a 1 or a 0. I'm trying to get the row numbers for any row that contains a zero regardless of which column its in. I can do this easily enough for one column using the following syntax:

selectedRows = datatable << Get Rows Where( As Column(colNameStr) == 0 );

However, when I want to do this for a number of columns, say in a list of column names or references, I'm stumped. I feel like this should be catered for, but I can't figure out if its possible or what the correct syntax is. For example

selectedRows = datatable << Get Rows Where( FOR EACH COLUMN IN LIST == 0 );

Any help on this matter would be greatly appreciated. The reason why I want it to work with a list is that I want it to work for any number of columns or column names. I'm using JMP11.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

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

Solution

list = {:A, :B, :C};

dt << Select Where(ANY(list));

This only works as is because you have boolean values in your columns.

3 REPLIES

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

list = {:A, :B, :C};

dt << Select Where(ANY(list));

This only works as is because you have boolean values in your columns.

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

Apr 29, 2015 8:01 AM
(782 views)

Thanks very much! I knew there was some way to do it. Out of curiosity, is there any way to do it for non-boolean values?

Thanks again!

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

Apr 30, 2015 7:12 AM
(782 views)

With the list? Can't think of anything off hand.

You could do

ANY(:A == "donkey", :B <=14, :C), C being a boolean still