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
Jemster
Level III

Loop for Recode

I have several columns of data with numbers in.

When I import the data from excel some columns get imported as strings.

I would like to be able to loop through all columns and change their data type to integer.

The below script is an attempt to change one column.

col_list = dt << Get Column Names ()

dt << Begin Data Update;
dt << Recode Column(
	dt;col_list[21],
	{Num( _rcNow )},
	Update Properties( 1 ),
	Target Column( ;col_list[21] )
);
dt << End Data Update;

The command  below gives the right column but the code above gives an error on line 5 stating "Source column cannot be found in access or evaluation of 'Glue' , dt; /*###*/col_list[21] /*###*/;" I was wondering if I had to write the code as an expression then evaluate it and substitute the column into the relevant parts.

Show(dt;col_list[2]);
1 ACCEPTED SOLUTION

Accepted Solutions
Jemster
Level III

Re: Loop for Recode

I found replacing 'dt;col_lis[21]' with 'as column(col_list[21])' solved my problem

View solution in original post

1 REPLY 1
Jemster
Level III

Re: Loop for Recode

I found replacing 'dt;col_lis[21]' with 'as column(col_list[21])' solved my problem

Recommended Articles