BookmarkSubscribeRSS Feed
jetpeach

Community Trekker

Joined:

Mar 30, 2016

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.

2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

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

Joined:

Apr 11, 2016

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

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