Script For Adding Spec Limits to a columnI am new to scripting
I am sure this is very straightforward, but I am looking to create a script that adds an upper spec limit to a column (No USL or Target required)
Many thanks for any guidance
Re: Script For Adding Spec Limits to a columnYou can not change the LSL and USL labels. You can load the limits as Response Limits, and it will label them RSL and LSL. Finally, you can add you own Reference Lines which will allow you to name them whatever you want.
Re: Script For Adding Spec Limits to a columnAlso, is there a way to rename to either LSL/USL to display some other name?
Re: Script For Adding Spec Limits to a columnHi Ian,
Is there a way to add LSL/USL based on grouping by a second column. For ex: have different LSL/USL based on whether student is boy or girl. So, when we plot weight age/weight by either boy or girl, the corresponding limits should be displayed on chart (LSL/USL only). if we plot the boy and girl height in one plot, the limit label could add _"groupby name" to the limit (ex: LSL_boy, USL_boy, LSL_girl, USL_girl).
Thanks,
Devesh
Re: Script For Adding Spec Limits to a columnThanks Ian...I'll give it a go
Andrew
Re: Script For Adding Spec Limits to a columnHere's one way:
NamesDefaultToHere(1);
// ******************************************************************************************
// Given a column reference, sets spec liomits property
// ******************************************************************************************
SetSpecLimits = function({c, lsl, usl, tar},
cmd = Expr(c << SetProperty("Spec Limits", {LSL(expr(lsl)), USL(expr(usl)), Target(expr(tar))}));
eval(evalexpr(cmd));
);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
SetSpecLimits(Column(dt, "height"), 60, ., .); // Set LSL only
SetSpecLimits(Column(dt, "weight"), 80, 120, 100); // Set all three values
Use 'Help > Scripting INdex' and 'Help > Books > Scripting Guide' to help figure out how it works.