Spec Limits are not normally calculated limits. They are set based on the design specifications or on the tool limitations, etc.
However, here is a simple script that will set the spec limits for all continuous columns in a data table using 3 sigma limits
Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt << get column names( string, continuous );
For Each( {col}, colNames,
theMean = Col Mean( As Column( dt, col ) );
theSTD = Col Std Dev( As Column( dt, col ) );
Eval(
Substitute(
Expr(
Column( dt, col ) << set property(
"Spec Limits",
{LSL( _LSL_ ), Target( _Target_ ), USL( _USL_ ), Show Limits( 1 )}
)
),
Expr( _LSL_ ), theMean - 3 * theSTD,
Expr( _Target_ ), theMean,
Expr( _USL_ ), theMean + 3 * theSTD
)
);
);
Jim