Hi all,
I'm trying to select columns based on a list of strings, and dump the columns into a group also based on the list.
Here's the code I'm using:
dt = Current Data Table();
// phase names by which we want to group
groupnames = {"Centering", "Dwell", "Capture", "Locking"};
// all column names in the table
allcols = dt << Get Column Names();
For( i = 1, i <= N Items( groupnames ), i++,
curgroup = {};
dt << Clear Column Selection;
// get all cols with the phase name
For( j = 1, j <= N Items( allcols ), j++,
If( Contains( allcols[j], groupnames[i] ),
As Column( allcols[j] ) << Set Selected( 1 );
//Insert Into(curgroup, allcols[j]);
);
);
// make a new group from these columns
//dt << Group Columns(char(groupnames[i]), curgroup);
dt << Group Columns( groupnames[i] );
);
I get the error "JMP cannot determine the columns to be grouped from the given script."
If I change the last line to something like dt << Group Columns ( "fixed string") it will work (but they'll all be in the same group). I'm not sure what I'm doing wrong. groupnames[i] should be a string (right?), which is the expected input for Group Columns().
Thanks,
Kristo