cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
kaoticllama
Level II

Set Spec Limits Using a Variable Instead of a Hard Coded Number

Hello,

 

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)});

 

kaoticllama_0-1715703775679.png

 

But this does not:

lowerLimit = 0;
upperLimit = 1;

Column(4) << Set Property("Spec Limits", {LSL(lowerLimit), USL(upperLimit), Show Limits(1)});

kaoticllama_1-1715703849054.png

Does anyone know a way around this? Thanks.

 

Best,

kaoticllama

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

A 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 )}
		)
	)
);
Jim

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

A 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 )}
		)
	)
);
Jim
kaoticllama
Level II

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

That works wonderfully, thanks again Jim!

Byron_JMP
Staff

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

The 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. 

 

Names Default To Here( 1 );
//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 ));

//Open the target data table to act on dt = Open( "$SAMPLE_DATA/Cities.jmp" );
//Script the Mangae Limits Platform
obj = dt << Manage Limits(Process Variables( :OZONE, :CO, :SO2, :NO )); obj << Load From Limits Table( dtLimits );  
obj << Save to Column Properties;
obj << Close Window
; 

 

JMP Systems Engineer, Health and Life Sciences (Pharma)
kaoticllama
Level II

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

Ah I see. Thanks for the info Byron!

jthi
Super User

Re: Set Spec Limits Using a Variable Instead of a Hard Coded Number

Few 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

 

jthi_0-1716182805829.png

 

-Jarmo