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
mystylelife19
Level III

Set spec limit columns properties from row selection

Hi Community,

 

Example from this table

mystylelife19_1-1698863405730.png

I have table that produce column Name of 5 people. All people have specific spec limit which is row HighL & LowL. Some of them never have spec limit either HighL & LowL or both. But i want to put spec limit on that people that have a high & low limit. Imaging that i have total 100 people that have randomly spec limit.

 

Could someone help me write a script that can automatically set the spec limit from row number 3 & 4 which is HighL & LowL in all column Name. Just put only spec limit Upper & Lower don't need a Target.

 

Pleaseeeeee..... i can't do manually on this method is too many of them.

7 REPLIES 7
jthi
Super User

Re: Set spec limit columns properties from row selection

If you rename your HighL to USL and LowL to LSL you might be able to already do this with Manage Spec Limits.

jthi_0-1698864617446.png

jthi_1-1698864632484.png

Load from Limits Table

jthi_2-1698864653713.png

Refer to same table

jthi_3-1698864672561.png

jthi_4-1698864679645.png

if you wish to see them, from red triangle add show limits to all

jthi_5-1698864703852.png

finally press Save to Column properties

jthi_6-1698864729307.png

(My Column 2 didn't get spec limits added as it has LSL which is higher than USL)

-Jarmo
mystylelife19
Level III

Re: Set spec limit columns properties from row selection

On my table sir, i have some name people that don't need to put spec limit on USL/LSL or both. Refer to my picture below.

mystylelife19_1-1698880504747.png

Do you know how to disable or delete all those number in single key or script that can only put the spec limit on number except LSL (-9.9999e+100) USL(9.9999e+100)

 

Also can you write me a script that can rename all those HighL & LowL into USL & LSL and put all the spec limit automatically in all those name except the infinity spec.

 

I will be an grateful on this help,

jthi
Super User

Re: Set spec limit columns properties from row selection

If you cannot change those values to missing, I would most likely:

  1. Create a subset with HighL and LowL rows and all columns
  2. Use recode to change HighL and LowL to USL and LSL
  3. Use recode to change 9.99e100 values to missing values (or some other method is also fine)
  4. Use the created subset as your limits table
  5. After limits have been set, close the subset

JMP can most likely script most of this for you with Enhanced Log / Workflow builder. It might not be able to script the process of getting limits from the table and then setting them as column properties from Manage Limits, but Scripting Index does have examples of that. Here is example for Load from Limits Table

jthi_0-1698902998668.png

 

-Jarmo
mystylelife19
Level III

Re: Set spec limit columns properties from row selection

Hi Sir,

 

I already created a script recode that rename the USL & LSL. But i still don't know how to change the value of 9.99e100 to missing in row selection not the column selection. I've tried many times still get fail. Also i stuck at write script to set all spec limit on all column properties. Please help me.

 

// Set Auto Spec Limit
Names Default To Here( 1 );
dt = Current Data Table();

// Recode column: Spec Limit
Local( {dt},
	dt = Current Data Table();
	dt << Begin Data Update;
	dt << Recode Column(
		dt:Spec Limit,
		{Map Value( _rcOrig, {"HighL", "USL", "LowL", "LSL"}, Unmatched( _rcNow ) )},
		Update Properties( 1 ),
		Target Column( :Spec Limit )
	);
	dt << End Data Update;
);

// Recode row: USL
Local( {dt},
	dt = Current Data Table();
	dt << Clear Select << Select Rows( [2] );
	selRows = dt << Get Selected Rows;
	dt << Begin Data Update;
	dt << Recode Selected Rows(
		dt:USL,
		{Map Value( _rcOrig, {"9.9999e+100", "."}, Unmatched( _rcNow ) )},
		Update Properties( 1 ),
		Target Row (:USL)
	);
	dt << End Data Update;
);

// Recode row: LSL
Local( {dt},
	dt = Current Data Table();
	dt << Clear Select << Select Rows( [3] );
	selRows = dt << Get Selected Rows;
	dt << Begin Data Update;
	dt << Recode Selected Rows(
		dt:USL,
		{Map Value( _rcOrig, {"-9.9999e+100", "."}, Unmatched( _rcNow ) )},
		Update Properties( 1 ),
		Target Row (:LSL)
	);
	dt << End Data Update;
);

Here below i attach the example data table that using this script.

txnelson
Super User

Re: Set spec limit columns properties from row selection

Recode works on columns, not on rows.  There is no such message in the Script Index named "Recode Selected Rows". To do what you appear to be attempting to do, you would need to

  1. Select the row in question
  2. Subset the selected row into a new data table
  3. Run the recode JSL for each of the columns in the subsetted data table that you want to have recoded.
  4. Use the Update Platform to move the data from the subsetted table back into the original data table.
Jim
mystylelife19
Level III

Re: Set spec limit columns properties from row selection

Hi Jim, thank you for your help. I manage to recode the certain Name in specific column. But how to write a script that can recode in whole column in my table? I really don't know how to write it. Is it to write for each one name? Because not every table i have a same name column. Please guide me.

 

// Recode column: Paul
Local( {dt},
	dt = Current Data Table();
	dt << Begin Data Update;
	dt << Recode Column(
		dt:Paul,
		{Map Value(
			_rcOrig,
			{-9.9999e+100, ., 9.9999e+100, .},
			Unmatched( _rcNow )
		)},
		Update Properties( 1 ),
		Target Column( :Paul )
	);
	dt << End Data Update;
);


// Clear row selection
dt << Clear Select;
jthi
Super User

Re: Set spec limit columns properties from row selection

One fairly simple option is when you have your subset with LSL and USL rows

jthi_0-1699254358763.png

Transpose this (much easier to input columns here with a script than to recode if I remember correctly)

jthi_1-1699254376702.png

Rename Label column to Variable, recode your LSL and USL columns

jthi_2-1699254457333.png

and use this table as your spec table

jthi_3-1699254512167.png

 

 

 

 

-Jarmo