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
CrownofTears
Level II

I cant move newly created columns to specific locations

I cant make my code work. I am trying to move some newly created columns to specific locations but I get the next error:

 

"Unrecognized key word"

 

Do you guys have any ideas of whats wrong here?

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		Column (ColNum+k), after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);
1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Try adding curly braces, like this:

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		{Column (ColNum+k)}, after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);

View solution in original post

4 REPLIES 4
mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Try adding curly braces, like this:

 

ColDelta=(ColNum-2)/2;
ColStart=4;

For(k=1, k<=ColDelta, k++,
	
	TabData << Move Selected Columns(
		{Column (ColNum+k)}, after(Column(ColStart))
	);
	ColStart=ColStart+3;
	
	
);
CrownofTears
Level II

Re: I cant move newly created columns to specific locations

Perfect! It worked perfectly. Do you have an explanation on why or when I should use the curly braces?

mmarchandTSI
Level V

Re: I cant move newly created columns to specific locations

Well, kind of.  I tried them, because it can take a list of columns.  In this case, it seems to want even a single column in list format.

jthi
Super User

Re: I cant move newly created columns to specific locations

You might find syntax information sometimes from JMP Help Scripting Guide > Data Tables > Work with Columns > Rearrange and Move Columns or JSL Syntax Reference (can be found from JMP Documentation page)

jthi_0-1692023185552.png

 

-Jarmo

Recommended Articles