cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Script to Insert Column(s) into the Middle of a Table
jay_holavarri
Level III

Finally checked to see if someone had already posted something like this and didn't see it. It's an irritant to me (maybe not a rational one) that you have to use >Cols > Add Multiple Columns... dialog to simply add a column in the middle of a table. This script mimics Excel's long-time approach: select a number of columns, click a command to insert that same number of columns adjacent to the selected columns.

I have this script pegged in my Cols menu (via the menu customization tool).

dt=current datatable();

col=dt<<get selected columns;

nc=nitems(col);

dt<<add multiple columns("boo",nc,after(col[nc]),character);