One example:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([0, 0, 1, 0])),
New Column("A_YIELD", Numeric, "Continuous", Format("Best", 12), Set Values([0, 0, 1, 0])),
New Column("B_YIELD", Numeric, "Continuous", Format("Best", 12), Set Values([1, 0, 0, 0])),
New Column("C_YIELD", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 0]))
);
// Get column names which end in _YIELD
yield_cols = Filter Each({col_name}, dt << Get Column Names("Continuous", "String"),
Ends With(col_name, "_YIELD");
);
// create new column to get _YIELD column name
dt << New Column("RESULT", Character, Nominal, << Set Each Value(
one_idx = Loc(dt[Row(), yield_cols], 1);
If(N Items(one_idx),
yield_cols[Min(one_idx)];
,
"PASS"
);
));
-Jarmo