cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
yves38
Level II

Assign values to selected rows

Hi,

I want to assign a value in a column for a set of rows selected.

I select the rows like this:

 

dt=current data tables();
dt << selectwhere(dt:columnA == "1" );

 

And I would like to assign the value "TEST" to the columnC for all the selected rows (only for the selected rows).

How can I do it very simply (i.e. without for loop)?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: Assign values to selected rows

It might be better to use '<<getRowsWhere()':

 

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Wait(3);
r = dt << getRowsWhere(:height < 55);
Column(dt, "weight")[r] = .;

 

And for JMP 13, see also:

 

https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013

 

View solution in original post

2 REPLIES 2
ian_jmp
Level X

Re: Assign values to selected rows

It might be better to use '<<getRowsWhere()':

 

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Wait(3);
r = dt << getRowsWhere(:height < 55);
Column(dt, "weight")[r] = .;

 

And for JMP 13, see also:

 

https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013

 

yves38
Level II

Re: Assign values to selected rows

Excellent !

Thank  you.

Recommended Articles