Adressing a variable number of columns as Y-axisI have a variable number of columns starting with "Alaska " on this follows a number starting from 01 to a variable maximum, e.g. 11.
I would like to have all these on the same Y column in a graph and the graph should be generated by the script.
I would be interested in the required code for adressing the variable number of Alaskas as Y column in the graph.
So the script should deliver an equivalent to this:
Y( :"Alaska 01"n ),
Y( :"Alaska 02"n, Position(1) ),
...
Y( :"Alaska 11"n, Position(1) ),
It would eb great if someone could help solving this issue.
Automation and ScriptingRe: Adressing a variable number of columns as Y-axisNames Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
prefix = "NPN";
cols = dt << Get Column Names("String");
collist = Filter Each({colname}, cols, Starts With(colname, prefix));
gb = Graph Builder(Parallel Axis Merging("Always"));
For Each({colname}, collist,
Eval(EvalExpr(
gb << Add Variable({Expr(NameExpr(AsColumn(dt, colname))), Role("Y"), Position(1)});
));
);
Write();