Choose Language Hide Translation Bar
Highlighted
Yngeinstn
Level IV

FInal Yield Table Problem

Mr. txnelson was kind enough to share with me a great script that assigns pass/fail to columns and then ultimately a final Pass/Fail based on the entire row. I would like to that final column into sub columns and while i know how it can be done conceptually, i can't figure out the correct syntax..

 

This piece of code finds the minimum of ALL columns however i would like to add subsets

Eval( Parse( "dt2 << New Column( \!"Row Pass/Fail\!", Formula( If( Min(" || foundCols || " ) == 1, 1, 0 ) )" ) );

 

Columns:
Row Pass/Fail

Test_1 Pass/Fail

Test_2 Pass/Fail

Test_3a Pass/Fail

Test_3b Pass/Fail

Test_3c Pass/Fail

Test_3d Pass/Fail

Test_3e Pass/Fail

Test_4_State_1 Pass/Fail

Test_4_State_3 Pass/Fail

Test_4_State_4 Pass/Fail

 

 

	colList = dt2 << Get Column Names( numeric, string );
	
	foundCols = "";
	
	For( i = 1, i <= N Items( colList ), i++,
	
		Spec = Column( dt2, colList[i] ) << Get Property( "Spec Limits" );
		
		dt2 << Clear Select;
		
		If( Is Empty( Spec ) == 0,
		
			dt2 << New Column( (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail" );
			
			If( Is Missing( Try( Spec["LSL"], . ) ) == 0,
			
				dt2 << Select Where( As Column( dt2, colList[i] ) < Spec["LSL"] );
				
				Try( Column( dt2, N Cols( dt2 ) )[dt2 << get selected rows] = 0 );
			);
			
			If( Is Missing( Try( Spec["USL"], . ) ) == 0,
			
				dt2 << Select Where( As Column( dt2, colList[i] ) > Spec["USL"], Current Selection( "Extend" ) );
				
				Try( Column( dt2, N Cols( dt2 ) )[dt2 << Get Selected Rows] = 0 );
			);
			
			dt2 << invert row selection;
			
			Try( Column( dt2, N Cols( dt2 ) )[dt2 << Get Selected Rows] = 1 );
			
			Column( dt2, N Cols( dt2 ) ) << Set Property( "Value Labels", {1 = "Pass", 0 = "Fail"} );
			
			If( foundCols == "",
				foundCols = ":Name(\!"" || (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail\!")",
				foundCols = foundCols || ", " || ":Name(\!"" || (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail\!")"
			);
		);
	);

 

10 REPLIES 10
Highlighted
txnelson
Super User

Re: FInal Yield Table Problem

There is a simple syntax error in your Eval(Parse()) statement.  A ")" was left out.  Here is a working version

Eval( Parse( "dt2 << New Column( \!"Row Pass/Fail\!", Formula( If( Min(" || foundCols || " ) == 1, 1, 0 ) ) )" ) );
Jim
Highlighted
Yngeinstn
Level IV

Re: FInal Yield Table Problem

Thank you. If you don't mind could you please help me the next part?

 

This code takes all columns {foundCols} that have the 'Pass/Fail' in it an finds the min value and utlimitately assigns pass  or fail.

 

Eval( Parse( "dt2 << New Column( \!"Row Pass/Fail\!", Formula( If( Min(" || foundCols || " ) == 1, 1, 0 ) ) )" ) );

How would one get different combinations of the foundCols say for instance i just want the columns with Rx State 3?

 

 

 

foundCols = {:Name( "7200_VDD_Dig_Rx Pass/Fail" ), 
:Name( "7200_Analog_Rx Pass/Fail" ),
:Name( "CH9 Rx State 3 Pass/Fail" ),
:Name( "CH8 Rx State 3 Pass/Fail" ),
:Name( "CH7 Rx State 3 Pass/Fail" ),
:Name( "CH6 Rx State 3 Pass/Fail" ),
:Name( "CH5 Rx State 3 Pass/Fail" ),
:Name( "CH4 Rx State 3 Pass/Fail" ),
:Name( "CH3 Rx State 3 Pass/Fail" ),
:Name( "CH2 Rx State 3 Pass/Fail" ),
:Name( "CH15 Rx State 3 Pass/Fail" ),
:Name( "CH14 Rx State 3 Pass/Fail" ),
:Name( "CH13 Rx State 3 Pass/Fail" ),
:Name( "CH12 Rx State 3 Pass/Fail" ),
:Name( "CH11 Rx State 3 Pass/Fail" ),
:Name( "CH10 Rx State 3 Pass/Fail" ),
:Name( "CH1 Rx State 3 Pass/Fail" ),
:Name( "CH0 Rx State 3 Pass/Fail" ),
:Name( "CH0 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH1 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH10 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH11 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH12 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH13 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH14 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH15 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH2 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH3 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH4 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH5 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH6 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH7 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH8 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH9 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "7100_VDD_Dig_Tx Pass/Fail" ),
:Name( "7100_Analog_Tx Pass/Fail" ),
:Name( "CH0 Tx State 1 Pass/Fail" ),
:Name( "CH1 Tx State 1 Pass/Fail" ),
:Name( "CH10 Tx State 1 Pass/Fail" ),
:Name( "CH11 Tx State 1 Pass/Fail" ),
:Name( "CH12 Tx State 1 Pass/Fail" ),
:Name( "CH13 Tx State 1 Pass/Fail" ),
:Name( "CH14 Tx State 1 Pass/Fail" ),
:Name( "CH15 Tx State 1 Pass/Fail" ),
:Name( "CH2 Tx State 1 Pass/Fail" ),
:Name( "CH3 Tx State 1 Pass/Fail" ),
:Name( "CH4 Tx State 1 Pass/Fail" ),
:Name( "CH5 Tx State 1 Pass/Fail" ),
:Name( "CH6 Tx State 1 Pass/Fail" ),
:Name( "CH7 Tx State 1 Pass/Fail" ),
:Name( "CH8 Tx State 1 Pass/Fail" ),
:Name( "CH9 Tx State 1 Pass/Fail" ),
:Name( "801 Pass/Fail" ),
:Name( "802 Pass/Fail" ),
:Name( "803 Pass/Fail" ),
:Name( "804 Pass/Fail" ),
:Name( "805 Pass/Fail" ),
:Name( "806 Pass/Fail" ),
:Name( "807 Pass/Fail" ),
:Name( "821 Pass/Fail" )}; 

 

Highlighted
txnelson
Super User

Re: FInal Yield Table Problem

I would just interactively create a new column, and then go into the Formula Editor and select just the Rx state columns to be evalueated

Jim
Highlighted
Yngeinstn
Level IV

Re: FInal Yield Table Problem

That is what i am currently doing however because analyzing multiple product lines that have the same Rx in the test name one of which has 300 different conditions inside that Rx i was hoping to do this dynamically so it would work across any exisiting and upcoming products..

Highlighted
txnelson
Super User

Re: FInal Yield Table Problem

I think what you can do is to simply create a new list that contains only the columns with the Rx 3 name, and then create a new column using that list to set values in the new column.  Something like:

newList = {};
For( i=1,i<=N Items(foundCols),i++,
	If(contains(foundCols,"Rx 3"),
		insert into( newList, foundCols[i]);
	)
);

Eval( Parse( "dt2 << New Column( \!"Rx 3 Row Pass/Fail\!", Formula( If( Min(" || newList || " ) == 1, 1, 0 ) ) )" ) );
Jim
Highlighted
Yngeinstn
Level IV

Re: FInal Yield Table Problem

I apolgozie i finally got time to revisit this since I originally posted. I am getting an error that "N Items() argument must be a list".

foundCols = ""; is the original code, not in a list.

Here is what i think should happen

 

 

listCols = { foundCols };
listCols = Eval List ( listCols );

 

 

At this point I have all the foundCols into a list however when i run the below script newList doesn't populate..

 

newList = {};

For( i = 1, i <= N Items( listCols ), i++,
    If( Contains( listCols, "TX" ),
        Insert Into( newList, listCols[i]);
    )
);

 

Thanks in advance

 

Highlighted
txnelson
Super User

Re: FInal Yield Table Problem

I realize that I made an error in my last entry.  The code to populate the NewList needs to be changed to:

newList = {};
For( i=1,i<=N Items(foundCols),i++,
	If(contains(foundCols[i],"Tx"),
		insert into( newList, foundCols[i]);
	)
);

Try this and see if it helps

Jim
Highlighted
Yngeinstn
Level IV

Re: FInal Yield Table Problem

Unfortunately it is still the same issue with the Error Message "N Items() argument must be a list{579}"

 

I believe you provided this bit of code back in the beginning of my journey down this path..

 

Oh and we have JMP 15 now so if there is another way of doing it i am all ears (eyes)...

 

Thank You

 

	colsToPassFail = dt3 << get column names( numeric, String );
	
	Show( colsToPassFail );
		
		foundCols = "";
		
		For( i = 1, i <= N Items( colsToPassFail  ), i++,
			Spec = Column( dt3, colsToPassFail[i] ) << Get Property( "Spec Limits" );
			dt3 << Clear Select;
			If( Is Empty( spec ) == 0,
				dt3 << New Column( ( Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail" );
				If( Is Missing( Try( spec["LSL"], . ) ) == 0,
					dt3 << Select Where( As Column( dt3, colsToPassFail[i] ) < spec["LSL"] );
					Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 0 );
				);
				If( Is Missing( Try( spec["USL"], . ) ) == 0,
					dt3 << Select Where( As Column( dt3, colsToPassFail[i] ) > spec["USL"], Current Selection( "extend" ) );
					Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 0 );
				);
				dt3 << Invert Row Selection;
				Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 1 );
				Column( dt3, N Cols( dt3 ) ) << set property( "Value Labels", {1 = "Pass", 0 = "Fail"} );
				If( foundCols == {},
					foundCols = ":Name(\!"" || (Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail\!")",
					foundCols = foundCols || ", " || ":Name(\!"" || (Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail\!")"
				);
			);
		);
		
		dt3 << Clear Select;
		
		txList = {};
		
		For( i = 1 ,i <= N Items( foundCols ), i++,
			If( Contains( foundCols[i], "TX" ),
				Insert Into( txList, foundCols[i]);
			)
		);
Highlighted
txnelson
Super User

Re: FInal Yield Table Problem

I assume the variable in question is "FoundCols".  You are setting it to a value of "", which makes the variable "FoundCols" a character string, not a list.  Then later in your code, you check to see if the variable "FoundCols" is equal to {}, which is it is not.  It is equal to "".  If you want to initialize "FoundCols" to an empty list, specify:

FoundCols = {};
Jim
Article Labels

    There are no labels assigned to this post.