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.
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