cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
AT
AT
Level V

how to calculate yield for many columns with embedded spec limits

Hi,

I have over 60 columns where individual spec limits are embeded in column properties. I like to calculate the yield for each row as Pass/Fail. I appreciate any script that will do this. I checked the JMP discussion and found one script that does yield but each columns is assumed to be pass or fail (1 or 0). Thanks

17 REPLIES 17
MarkDayton
Level IV

Re: how to calculate yield for many columns with embedded spec limits

Thanks, can't wait to test it out!

deerhntr
Level I

Re: how to calculate yield for many columns with embedded spec limits

Jim,

 

This script has been in the forum for quite a while. I like it, and for 50 or 60 columns it works well. I recently attempted to yield a set of PCM test structures where I have well over 1000 columns. I found the MIN() formula seems to be breaking. Do you have any idea on column limits or other variable limits that may be limiting how many arguments i can use in the formula? Your thoughts would be appreciated

 

Thanks,

Russ

AT
AT
Level V

Re: how to calculate yield for many columns with embedded spec limits

Thanks Jim. I ran the script and ColNamesList is not defined and got an error. The yield table is created.

txnelson
Super User

Re: how to calculate yield for many columns with embedded spec limits

My error, add this line

colNamesList={"Parm 1","Parm 2"};

before the setPassFail Function definition.

Jim
AT
AT
Level V

Re: how to calculate yield for many columns with embedded spec limits

Thanks Jim. It works now. This is a great script. It can be generalized to many columns. I will play with it more. Thanks again.

EvanJ
Level I

Re: how to calculate yield for many columns with embedded spec limits

@txnelson ,

This script is proving very useful. Thanks. Found one thing that I have not been able to correct myself yet. If there is a missing value the script marks it as a pass when it inverts the selection and assigns a value of 1. I'd prefer it to assign "Missing" but everything I've tried is coming up short.

EvanJ
Level I

Re: how to calculate yield for many columns with embedded spec limits

This script will asign "Missing" in the final "Row Pass/Fail" column if 1 or more values are missing.

 

foundCols = "";

// Loop across the columns and generate the test pass/fails
For( i = 1, i <= N Items( colList ), i++,
	spec = Column( EVALdt, colList[i] ) << get property( "Spec Limits" );
	EVALdt << clear select;
	If( Is Empty( spec ) == 0,
	
		EVALdt << New Column( (Column( EVALdt, colList[i] ) << get name) || " Pass/Fail" );
		
		If( Is Missing( Try( spec["LSL"], . ) ) == 0,
			EVALdt << select where( As Column( EVALdt, colList[i] ) < spec["LSL"] );
			Try( Column( EVALdt, N Cols( EVALdt ) )[EVALdt << get selected rows] = 0 );
		);
		
		If( Is Missing( Try( spec["USL"], . ) ) == 0,
			EVALdt << select where( As Column( EVALdt, colList[i] ) > spec["USL"], current selection( "extend" ) );
			Try( Column( EVALdt, N Cols( EVALdt ) )[EVALdt << get selected rows] = 0 );
		);
		
		EVALdt << select where( IsMissing( As Column( EVALdt, colList[i] ) ), current selection( "extend" ) );
		
		EVALdt << invert row selection;
		
		Try( Column( EVALdt, N Cols( EVALdt ) )[EVALdt << get selected rows] = 1 );
		
		Column( EVALdt, N Cols( EVALdt ) ) << set property( "Value Labels", {0 = "Fail", 1 = "Pass"} );
		If( foundCols == "",
			foundCols = ":Name(\!"" || (Column( EVALdt, colList[i] ) << get name) || " Pass/Fail\!")",
			foundCols = foundCols || ", " || ":Name(\!"" || (Column( EVALdt, colList[i] ) << get name) || " Pass/Fail\!")"
		);
	);
);

// Create the Row Missing/Pass/Fail
Eval( Parse( "EVALdt << New Column( \!"Row Pass/Fail\!", formula( If( N Missing("||foundCols||") > 1, \!"Missing\!", Min(" || foundCols || " ) == 1, \!"Pass\!", \!"Fail\!" ) ))" ) );
SpannerHead
Level IV

Re: how to calculate yield for many columns with embedded spec limits

Great script, very helpful.  Wondering if this could be adapted to add a 3rd category where the data is missing?


Slán



SpannerHead