There are many ways of doing this. Below is one example which should get you what you need:
Names Default To Here(1);
dt = Open("$DOWNLOADS/Sample data.jmp");
col_names = (dt << Get Column Names("String"))[2::(N Cols() - 2)];
m = dt[0, col_names];
Column(dt, "Maximum Value") << Set Values(V Max(m`));
Column(dt, "Maximum Col Name") << Set Data Type("Character");
Column(dt, "Maximum Col Name") << Set Each Value(
max_idx = Loc(m[Row(), 0], :Maximum value)[1];
col_names[max_idx];
);
Edit: Copy pasted correct script
Edit2: Second quite similar option:
Names Default To Here(1);
dt = Open("$DOWNLOADS/Sample data.jmp");
Column(dt, "Maximum Col Name") << Set Data Type("Character");
col_names = (dt << Get Column Names("String"))[2::(N Cols() - 2)];
Column(dt, "Maximum Value") << Set Each Value(Max(dt[Row(), col_names]));
Column(dt, "Maximum Col Name") << Set Each Value(
// could use loc max, but as we need maximum value in column, we can just use that with Loc
max_idx = Loc(dt[Row(), col_names], :Maximum value)[1];
col_names[max_idx];
);
-Jarmo