Set Spec Limits Using a Variable Instead of a Hard Coded NumberHello,
I am trying to automate setting spec limits for a column. It seems that this process is easily done using a hard coded value, but doesn't work when you input the spec limit as a variable. So this works:
Column(4) << Set Property("Spec Limits", {LSL(0), USL(1), Show Limits(1)});

But this does not:
lowerLimit = 0;
upperLimit = 1;
Column(4) << Set Property("Spec Limits", {LSL(lowerLimit), USL(upperLimit), Show Limits(1)});
Does anyone know a way around this? Thanks.
Best,
kaoticllama
Automation and ScriptingData Exploration and VisualizationRe: Set Spec Limits Using a Variable Instead of a Hard Coded NumberFew additional notes:
- Manage spec limits is much easier to use BUT it might not always work as some of the column names tend to be very strict in the spec table.
- JMP isn't able to record the button presses in Manage Spec Limits platform (enhanced log/workflow) so you will have to do little scripting here but the messages are very easy to find from scripting index under Manage Limits as they are same as those button names.
- Method Jim provided will always work but it will require scripting. One great thing about learning this, is this is not the only place where this can be used.
(I use both but more Manage Spec Limits method just for setting the spec limits).
Also to show spec lines in your graphs, before sending the
obj << Save to Column Properties;
send
obj << Show Limits All;
to enable the check mark

Re: Set Spec Limits Using a Variable Instead of a Hard Coded NumberAh I see. Thanks for the info Byron!
Re: Set Spec Limits Using a Variable Instead of a Hard Coded NumberThat works wonderfully, thanks again Jim!
Re: Set Spec Limits Using a Variable Instead of a Hard Coded NumberThe answer from @txnelson is perfect; however, when working with spec limits, scripting platforms presents a simpler and more versatile solution.
In this example from the Scripting Index (search for "load limits" or "save to column prop") a limits table is created first. You might already have this table (or matrix) created.
After the target data table is opened, then the Manage Limits platform is used to load the limits from the defined limits table, and then the limits are saved to the target data table.
;</CODE> <BR /><CODE class=" language-jsl">Names Default To Here( 1 );<BR />//First construct a table of limits for the example
dtLimits = New Table( "Cities Limits",Add Rows( 4 ),
New Column( "Process",Character,Set Values( {"OZONE", "CO", "SO2", "NO"} )),
New Column( "LSL", Numeric, Set Values( [0, 0, 0, 0] ) ),
New Column( "Target",Numeric,Set Values( [0.2, 15, 0.05, 0.035] )),
New Column( "USL",Numeric,Set Values( [0.4, 30, 0.1, 0.07] )),
Set Label Columns( :Process ));<BR /><BR />//Open the target data table to act on
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
<BR />//Script the Mangae Limits Platform<BR />obj = dt << Manage Limits(Process Variables( :OZONE, :CO, :SO2, :NO ));
obj << Load From Limits Table( dtLimits ); <BR />obj << Save to Column Properties;<BR />obj << Close Window
Re: Set Spec Limits Using a Variable Instead of a Hard Coded NumberA JMP list can be anything, so when you specify something like upperLimit in a list, JMP just assumes you want exactly that in the list. To tell JMP to process what is in the list, before creating the list you can do the following
Names Default To Here( 1 );
lowerLimit = 0;
upperLimit = 1;
Eval(
Eval Expr(
Column( 4 ) << Set Property(
"Spec Limits",
{LSL( Expr( lowerLimit ) ), USL( Expr( upperLimit ) ), Show Limits( 1 )}
)
)
);