BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
jetpeach
Community Trekker

Moving column group to 'after column' is only moving it to the first

​I'm trying something that seems simple - moving a column group to a location after another column.

Moving "to last" works, "to first" works, but after doesn't for me, no matter how i mess with format.

Below is example code to test -

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Cities.jmp" );

dt << group columns( "xy", {:X, :y} );

dt << group columns( "pollutants", :Ozone :: :Lead );

dt << move column group( to first, "xy" );

this worked but if

dt << move column group( after("Latitude"), "xy" );

instead of the "to first"

then I get very strange behavior - BOTH the groups move the first location in the dt.

0 Kudos
2 REPLIES 2
Highlighted
txnelson
Super User

Re: Moving column group to 'after column' is only moving it to the first

Move Column Group does not have the "after" argument like  Move Selected Columns does.

However, you can select the group, and then use

     dt << Select Column Group("xy");

     dt << Move Selected Columns(after("?????"));

Jim
altug_bayram
Community Trekker

Re: Moving column group to 'after column' is only moving it to the first

I can confirm that your solution Jim does indeed work....