This works too:
Names Default To Here(1);
dt1 = New Table( "Test", Add Rows( 6 ),
New Column( "X", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 1, 2, 4] ) ),
New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [3, 2, 5, 6, 4, 3] ) ),
New Column( "XY Group", Character, "Nominal", Set Selected,
Set Values( {"A", "A", "A", "B", "B", "B"} ) )
);
sc = dt1 << get selected Columns;
scn = Column(sc[1]) << get name; // sc is a list - get the first highlighted column
Show(sc);
Show(scn);
obj = dt1 << Fit Curve(
Y(:Y),
X(:X),
Fit linear,
by (column(dt1, scn))
);