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
ValeriaJMP
Level I

Creating a column checking all the spec limits saved as colum properties

Hi all,

I am checking several parameters for some products, e.g. length and width. Each parameter is a column with spec limits as column property. Each row is the product. How do I automatically created a column called "InSpec" that tells me whether the product (row) is in or out of spec for all the parameters (columns) with assigned spec limits WITHOUT having to write an IF statement as a formula for the "InSpec" column. This is because I have tons of spec parameters to check (saved in a spec table). I already used a for loop to assign the spec limits as column properties, so I figured there might be a way to check for all the specs as once.

 

Thank you!

3 REPLIES 3
jthi
Super User

Re: Creating a column checking all the spec limits saved as colum properties

JSL can do this. These posts have some ideas about what you could do

 How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly crea... and Scripters Club Recordings: Tips and Tricks. And there are also other methods.

-Jarmo
hogi
Level XII

Re: Creating a column checking all the spec limits saved as colum properties

Under the line:
Please vote here 🙏 is in spec (value) .

txnelson
Super User

Re: Creating a column checking all the spec limits saved as colum properties

Here is a script I wrote that cycles through all columns and if the column has spec limits, it creates a new column and sets all passing rows to 1 and all failing columns to 0.  It also colors the cells for the non passing values to red.

txnelson_0-1732589473412.png

Names Default To Here( 1 );
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNames = dt << get column names( string, numeric );

For Each( {col}, colNames,
	specs = {};
	specs = Try( Column( dt, col ) << get property( "spec limits" ), {} );
	If( specs != Empty(),
		dt << New Column( Column( dt, col ) << get name || " in Spec?", set each value( 1 ) );
		lsl = specs["LSL"];
		usl = specs["USL"];

		inSpec = dt << get rows where( !(As Column( dt, col ) >= lsl & As Column( dt, col ) <= usl ));
		If( Length( inSpec ) > 0,
			Column( Column( dt, col ) << get name || " in Spec?" )[inSpec] = 0;
			Column( col ) << color cells( "Red", inSpec );
		);
	);
);
Jim