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

- JMP User Community
- :
- Discussions
- :
- How do find the serial Numbers of two columns in a table directly from their dat...

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

Highlighted

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

Created:
Jun 26, 2020 5:35 AM
| Last Modified: Jun 26, 2020 5:36 AM
(595 views)

Take this sample form.

`dt = Open( "$SAMPLE_DATA/Lung Cancer.jmp" );`

Columns 1 and 2 comprise data that does not duplicate.

Now what do want to do for JSL to find a single serial number that combines "NonSmoker" and "Cancer"?

Let's say have a lot of rows.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

The issue is that JMP is getting confused on how to construct the final outcome of your statement

r=dt<<get rows where(:smoker=="NonSmoker" & :lung Cancer == "Cancer" )[1,1];

If you use a pair of "()" to help JMP understand that [1,1] is talking about what is returned from the Get Rows Where(), your code will work.

`r=(dt<<get rows where(:smoker=="NonSmoker" & :lung Cancer == "Cancer" ))[1,1];`

Jim

5 REPLIES 5

Highlighted
##

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

Re: How do find the serial Numbers of two columns in a table directly from their data?

?????

```
dt = Open( "$SAMPLE_DATA/Lung Cancer.jmp" );
show(dt<<get rows where(:smoker=="Smoker" & :lung Cancer == "Cancer" ));
```

Jim

Highlighted
##

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

Re: How do find the serial Numbers of two columns in a table directly from their data?

Thank Jim!

Yes, exactly.

How do get

r = 3

、

Rather than

r = [3]

Highlighted
##

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

Re: How do find the serial Numbers of two columns in a table directly from their data?

Matrix

```
dt = Open( "$SAMPLE_DATA/Lung Cancer.jmp" );
mat = dt << get rows where( :smoker == "NonSmoker" & :lung Cancer == "Cancer" );
r = mat[1, 1];
```

But I don't understand that if I write this directly, it won't work:

`dt = Open( "$SAMPLE_DATA/Lung Cancer.jmp" ); r=dt<<get rows where(:smoker=="NonSmoker" & :lung Cancer == "Cancer" )[1,1];`

Thanks!

Highlighted

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

The issue is that JMP is getting confused on how to construct the final outcome of your statement

r=dt<<get rows where(:smoker=="NonSmoker" & :lung Cancer == "Cancer" )[1,1];

If you use a pair of "()" to help JMP understand that [1,1] is talking about what is returned from the Get Rows Where(), your code will work.

`r=(dt<<get rows where(:smoker=="NonSmoker" & :lung Cancer == "Cancer" ))[1,1];`

Jim

Highlighted
##

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

Re: How do find the serial Numbers of two columns in a table directly from their data?

Thank Jim!

I'm still learning basic grammar.

I'm still learning basic grammar.