cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Newbie2Jumpie
Level IV

Move column to first using JSL script

Hi JMP community

 

I seem to have a simple question.

I want to move a specific column to the first position using JSL script.

 

I started withselecting it

:"That's my column" << set selected (1) ; /*seemed OK*/

 

However, ...

move selected column ( (:"That's my column"), to first) ;

...just doesn't work. Could you help me solve this one?

Thanks a lot!

2 REPLIES 2
txnelson
Super User

Re: Move column to first using JSL script

The JSL documentation in both the Scripting Index and in the Scripting Guide is confusing......I would even say it is wrong.  However, the following JSL shows a couple of correct methods to do what you want to do:

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

:weight << set selected(1);

dt << move selected columns( To First );

// Or you can use this form
dt2=open("$SAMPLE_DATA/Trial1.jmp");

dt2 << move selected columns( {"yield"}, To First);
Jim
Newbie2Jumpie
Level IV

Re: Move column to first using JSL script

Hi txnelson
You saved my day. I'll check the syntax solutions first thing tomorrow.
Until then: Thanks a lot!
Newbie2