I think the following script is a better approach for you to take in finding the First Fail test. This script creates a new column, and populates the column with the name of the First Fail Column
txnelson_0-1669924154108.png
Names Default To Here( 1 );
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");
USLVals = LSLVals = [];
For( i = 5, i <= N Cols( dt ), i++,
USLVals = USLVals || Matrix( (Column( dt, i ) << get property( spec limits ))["USL"] );
LSLVals = LSLVals || Matrix( (Column( dt, i ) << get property( spec limits ))["LSL"] );
);
dt << New Column( "First Fail", character );
For( i = 1, i <= N Rows( dt ), i++,
theMin = Min(
Min( Loc( (USLVals < dt[i, Index( 5, N Cols( dt ) - 1 )]) ) ),
Min( Loc( (dt[i, Index( 5, N Cols( dt ) - 1 )]) < LSLVals ) )
);
:First Fail[i] = Column( dt, theMin + 4 ) << get name;
);
Jim