Here is the way I would handle your table. It moves all of the USL and LSL values into the column property for each of the columns, and then the limits are automatically displayed when you graph the columns
Names Default To Here( 1 );
dt = Current Data Table();
colNamesList = dt << get column names( string, numeric );
For Each( {col}, colNamesList,
LSL = Column( col )[(dt << get rows where( :Label == "LSL" ))[1]];
USL = Column( col )[(dt << get rows where( :Label == "USL" ))[1]];
Eval(
Substitute(
Expr(
Column( col ) << set property(
"spec limits",
{LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
)
),
Expr( _USL_ ), USL,
Expr( _LSL_ ), LSL
)
);
);
// Uncomment the below 2 lines to delete the LSL and USL rows in the table
//dt << select where(:Label == "LSL" | :Label=="LSL");
//dt << delete rows;
Graph Builder(
Size( 570, 578 ),
Variables( X( :partID ), Y( :Current ), Y( :Resistance ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 8 ), Jitter( "None" ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 6 ), Jitter( "None" ) ) ),
Local Data Filter( Add Filter( columns( :Label ), Where( :Label == {"Median"} ) ) )
);
Jim