cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

Data table - If one column has empty value, then use other column value to fill in,other row keep no change

Names Default To Here( 1 );

//If the original data table is like below, 
// there are 2 empty value(:sex[3] and :sex[4] )in column sex:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:sex[3 4] = black;

 

I want the function is:

when search all values in column :sex, if find column sex have empty value, then fill the column :name value into the empty position in :sex while keep other value in :sex with no change.

1 REPLY 1
jthi
Super User

Re: Data table - If one column has empty value, then use other column value to fill in,other row keep no change

One way to script it would be using << set each value with if to check for empty string (if numeric you have to change the if to use IsMissing()).

 

names default to here(1);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:sex[3::4] = "";

dt:sex << Set Each Value(If(:sex == "", :name, :sex));

 

-Jarmo

Recommended Articles