It was my error, I left out a ")". Try this code
Names Default To Here( 1 );
dt = Current Data Table();
// Only one set of Spec Limits per column can be set,
// therefore split the data into separate columns
// and set the separate limits for each column
dtSplit = dt << Split( Split By( :TYPE ), Split( :NUMERIC_RESULT ), Sort by Column Property );
// Get the names of the generated columns
colList = dtSplit << get column names( string );
// Loop across the columns and create the spec limits for each column
For( i = 1, i <= N Items( colList ), i++,
Eval(
Substitute(
Expr(
__col__ << set property(
"spec limits ",
{LSL( __LSL__ ), USL( __USL__ ), show limits( 1 )}
)
),
Expr( __col__ ), Parse( "dtSplit:" || colList[i] ),
Expr( __LSL__ ),
Eval(
Parse(
"col mean(dtSplit:" || colList[i] || ")-6*col std dev(dtSplit:" || colList[i
] || ")"
)
),
Expr( __USL__ ),
Eval(
Parse(
"col mean(dtSplit:" || colList[i] || ")+6*col std dev(dtSplit:" || colList[i
] || ")"
)
)
)
)
);
// Create a literal string that contains the JSL required to
// generate the Distributions
theExpr = "Distribution(
Arrange in Rows( 1 ),";
theExpr = theExpr || Char(
Substitute(
Expr(
Continuous Distribution(
Column( __col__ ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Normal Quantile Plot( 1 )
)
),
Expr( __col__ ), Parse( "dtSplit:" || colList[1] )
)
);
For( i = 2, i <= N Items( colList ), i++,
theExpr = theExpr || "," || Char(
Substitute(
Expr(
Continuous Distribution(
Column( __col__ ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Normal Quantile Plot( 1 )
)
),
Expr( __col__ ), Parse( "dtSplit:" || colList[i] )
)
);
);
theExpr = theExpr || ");";
// Run the generated code
Eval( Parse( theExpr ) );
Jim