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
- :
- Question on JMP Row Selection.

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

Jun 29, 2015 10:49 AM
(571 views)

Can we use the following query

dt = Open("tablename");

r = dt << Get Rows Where(:testid in ('1','2'));

5 REPLIES

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

Jun 29, 2015 11:01 AM
(381 views)

there are probably other ways, here's one:

r = dt << Get Rows Where( contains( {"F", "M" }, sex ) );

**[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,**

**24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]**

Craige

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

Jun 29, 2015 2:51 PM
(381 views)

JMP doesn't have an In() function the way SQL does.

You'll need to test each value individually, like this:

dt = Open("tablename");

r = dt << Get Rows Where(:testid == '1' | :testid == '2');

-Jeff

-Jeff

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

Jun 29, 2015 7:20 PM
(381 views)

If you have a lot of values to look for C Hales solution is the way to go. Works in a similar manner to a SQL IN list.

BTW when is JMP going to put SQL into the product???? PROC SQL has been in SAS for a long time now.

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

Jun 30, 2015 6:18 AM
(381 views)

PMroz and Craige@JMP are right.

I misunderstood Craige@JMP's example.

Here's one that might be clearer.

dt=open

("$SAMPLE_DATA\Big Class.jmp");//get the rows for ages 13 and 17

age13and17=dt<<

get rows where(contains({"13", "17"}, char(:age)));//select those rows

dt<<

select rows(age13and17);

-Jeff

-Jeff

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

Jun 30, 2015 6:54 AM
(381 views)