The detour via strings makes sense : )
I wonder why is it necessary ...
Names Default To Here(1);
// Setup
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dd= dt << group columns("xy", {:X, :y});
ee= dt << group columns("pollutants", :Ozone :: :Lead);
Type(ee)
collist = dt << Get Column Names();
grouped_list = {};
groups= dt << get column groups names;
For Each({groupname},groups,
groupcols= dt << get column group(groupname);
Insert Into(grouped_list, groupcols);
);
Show(grouped_list); // list of names with ":" {:OZONE, :CO, :SO2, :NO, :PM10, :Lead, :X, :Y};
show(collist);// list of names without ":" {city, Latitude, Longitude, ... }
nongrouped = Set Difference(collist, grouped_list); // ?!?! {city, CO, Latitude, Lead, Longitude, Max deg. F Jan, NO, OZONE, PM10, POP,"pop- m"n, Region, SO2, State, X, Y}
details which are important to know:
- The return value of of << group columns is a string - not a column group.
<< get column group returns a list of columns, not a column group
- important: THIS list of columns lists the names with leading ":"
- compare: get column names() returns a list of names without the leading ":"
- -> the two lists are not compatible with each other
Workarounds:
convert to list of columns = Function ({myColList},
Transform each({col},myColList, Name Expr(As column(dt, col)))
);
grouped_list = convert to list of columns(grouped_list); // looks like before, but is something completely different
collist = convert to list of columns(collist); //{:city, :Latitude, :Longitude, ... }
nongrouped = Set Difference(collist, grouped_list);
Show (nongrouped) // {:city, :Latitude, :Longitude, :Max deg. F Jan, :POP, :"pop- m"n, :Region, :State};