If your column names(?) have always step1_something format, you could use Word to separate the step from rest of the string to make comparison easier. Below is an example of what I think you would like to do (requires JMP16 due to For Each):
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
Set Header Height(44),
New Column("Col1", Character, "Nominal", Set Values({"step1", "step2", "step3"})),
New Column("step1_a", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("step1_b", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("step1_c", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("step2_a", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("step2_b", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .]))
);
Summarize(dt, uniq_vals = by(:col1));
col_list = dt << get column names(string, continuous);
//initialize col group collector associative array
col_groups = Repeat({{}}, N Items(uniq_vals));
For Each({col_name}, col_list,
found_idx = Contains(uniq_vals, Word(1, col_name, "_"));
If(found_idx,
Insert Into(col_groups[found_idx], col_name);
);
);
For Each({col_group, idx}, uniq_vals,
If(N Items(col_groups[idx]) > 0,
Eval(EvalExpr(dt << Group Columns(col_group, Expr(col_groups[idx]))));
);
);
-Jarmo