I'm trying to write a robust script that will allow the user to specify a Sigma K value and select Y columns from a list of all the continuous columns and create the L-J charts for each and save the limits to a tall data table.
The script isn't creating any errors but isn't creating the graphical output.
I can't see where I'm going wrong, script below and attached
Thanks
Names Default To Here(1);
dt = Current Data Table();
// Get list of continuous columns
contCols = {};
For(i = 1, i <= N Cols(dt), i++,
col = Column(dt, i);
If(col << Get Modeling Type == "Continuous",
Insert Into(contCols, col << Get Name)
);
);
If(N Items(contCols) == 0,
Show Message(
"No continuous columns found.", "Please ensure your data table has continuous columns."
);
Stop();
);
// Dialog for selecting columns and k
colList = .;
kNum = .;
dialogResult = .;
nw = New Window("Levey-Jennings Chart Setup",
<<MODAL></MODAL>
Edit (jthi): added jsl formatting
There are plenty of mistakes in the script and I assume it was created by some LLM. If you wish to do scripting in JMP outside of JMP created scripts, I suggest you check out Scripting Guide .
View more...
Names Default To Here(1);
dt = Current Data Table();
nw = New Window("Levey-Jennings Chart Setup", << Type("Modal Dialog"),
H List Box(
Lineup Box(N Col(1),
Text Box("Select up to 50 continuous columns:"),
fcs = Filter Col Selector(dt, << Nominal(0), << Ordinal(0), << Continuous(1), Character(0), << Set Max Selected(50)),
Text Box("Enter k (number of SDs for Shewhart control limits):"),
neb = Number Edit Box(3)
),
Lineup Box(N Col(1),
Button Box("OK",
selcols = fcs << get selected;
ksig = neb << get;
),
Button Box("Cancel")
)
)
);
If(nw["Button"] != 1,
Throw("Cancelled");
);
If(N Items(selcols) == 0,
Throw("No columns selected");
);
collist = Transform Each({colname}, selcols, Name Expr(AsColumn(dt, colname)));
Substitute Into(collist, Expr(List), Expr(Y));
ccb = Eval(EvalExpr(dt << Control Chart Builder(
Show Two Shewhart Charts(0),
K Sigma(Expr(ksig)),
Variables(Expr(Name Expr(collist))),
Chart(Points(Statistic("Individual")), Limits(Sigma("Levey Jennings"))),
Show Control Panel(0)
)));
Thank you - perfect
I'll go through line by line and try and understand what's happening
Hi @NBrammer ,
I really like this guide from Don McCormack about running platforms without knowing the column names or number of: https://community.jmp.com/t5/JSL-Cookbook/Run-a-Platform-without-Knowing-the-Number-or-Names-of-Columns/ta-p/464407
Thanks,
Ben