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

- JMP User Community
- :
- Discussions
- :
- Settings value of column based on selected column in a summary table

- 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

Dec 13, 2018 3:31 AM
(3234 views)

Hi experts.

I have a linked summary table, in which i select rows, based on a criteria.

In my main table, I now need to set a specific value in a column, for the selected rows.

I have made a basic table with the following:

Sample error

s1 0

s1 0

s1 0

s2 0

s2 0

s2 0

I have some very simplified code as an example:

dt = current data table();

dt_sum = dt << Summary(

Group( :sample),

Freq( "None" ),

Weight( "None" )

);

dt_sum << select where (:sample == "s1");

r = dt << get selected rows;

close(dt_sum, nosave);

column(dt, "error")[r] = 1;

The code runs, if the dt_sum is closed. In my code however, this is not possible, as it is needed later.

I get the following error, if dt_sum is not closed

"Cannot set value for the column 'error' because the row number (-1) is not valid.{1}"

Further more, the error value for line 1 and 4 is changed to 1, but not the rest.

Can any of you explain me why this is not working, or help me with a possible workaround?

Thanks in advance, Anders

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

1. I think you should submit the issue to JMP Support. It appears that eventhough you are directly pointing to the "dt" data table, it is still looking to the "dt_sum" data table and updating there.

2. Here is a work around that allows the code to work

```
dt = current data table();
dt_sum = dt << Summary(
Group( :sample),
Freq( "None" ),
Weight( "None" )
);
dt_sum << select where (:sample == "s1");
r = dt << get selected rows;
//close(dt_sum, nosave);
current data table(dt);
column(dt, "error")[r] = 1;
```

Jim

2 REPLIES 2

Highlighted

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

1. I think you should submit the issue to JMP Support. It appears that eventhough you are directly pointing to the "dt" data table, it is still looking to the "dt_sum" data table and updating there.

2. Here is a work around that allows the code to work

```
dt = current data table();
dt_sum = dt << Summary(
Group( :sample),
Freq( "None" ),
Weight( "None" )
);
dt_sum << select where (:sample == "s1");
r = dt << get selected rows;
//close(dt_sum, nosave);
current data table(dt);
column(dt, "error")[r] = 1;
```

Jim

Highlighted
##

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

Re: Settings value of column based on selected column in a summary table

Thanks, that does it :)

Article Labels

There are no labels assigned to this post.