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
- :
- Re: << Get Values from a Column without subsetting each set of 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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 15, 2014 4:52 PM
(9073 views)

So, I have a big dataset. Currently I am selecting few rows for each condition, subsetting the data and run << get values (im My JSL script) to move data to defined LIST. This process is taking significant time, because as i mentioned dataset is huge.

I want to know, if there is a way to << get values from a column for the selected rows without doing subset everytime. \

Or I have to subset every time to << get values from desired ROW\Column.

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

You can get the value of a column for a given row by subscripting to that row.

For example:

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
:name[1];
```

Will return "Katie" which is the name in the first row.

Likewise, you can use a matrix for the subscript.

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
:name[[2,3,4]];
```

That returns:

{"LOUISE", "JANE", "JACLYN"}

You can probably see where this is headed. The <<Get Selected Rows message returns a matrix, so you can use that to subscript directly to the column.

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
rows=dt<<get selected rows;
:name[rows];
```

-Jeff

2 REPLIES 2

Highlighted

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

You can get the value of a column for a given row by subscripting to that row.

For example:

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
:name[1];
```

Will return "Katie" which is the name in the first row.

Likewise, you can use a matrix for the subscript.

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
:name[[2,3,4]];
```

That returns:

{"LOUISE", "JANE", "JACLYN"}

You can probably see where this is headed. The <<Get Selected Rows message returns a matrix, so you can use that to subscript directly to the column.

```
dt=open("$SAMPLE_DATA\Big Class.jmp");
rows=dt<<get selected rows;
:name[rows];
```

-Jeff

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

Re: << Get Values from a Column without subsetting each set of row selection.

Yes, thanks you. will try that.