Thank you for the fast reply Jim. I was trying to set the Control Limits and the Sigma property and was getting an error for:
too many arguments in access or evaluation of 'Expr' , Expr/*###*/(Column( finalDt, colNamesList[i] ) <<
Set Property(
"Control Limits",
{Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ) )}
), Column( finalDt, colNamesList[i] ) << Set Property( "Sigma", __sigma__ ))
The problem was that I was trying to define two different column properties in the same substitute expression. After breaking it up into 2 Evals, it works. See below.
Current Data Table( finalDt );
Wait(0);
// Get list of columns to chart
colNameList = finalDt << get column names( continuous, string );
// Loop across all of the columns and create the charts
For( i = 2, i <= N Items( colNameList ), i++,
// If limits exist for the current column, then process
If( Try( Column( dtLimits, colNameList[i] ) << get name ) != "",
// get the limits needed
// sigma
theSigma = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_Std Dev" ))[1]];
theAvg = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_Mean" ))[1]];
theLCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_LCL" ))[1]];
theUCL = Column( dtLimits, colNameList[i] )[(dtLimits << get rows where( :_LimitsKey == "_UCL" ))[1]];
Eval(
Substitute(
Expr( __process__ << Set Property("Control Limits", {Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ))})),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __avg__ ), theAvg,
Expr( __LCL__ ), theLCL,
Expr( __UCL__ ), theUCL
)
);
Eval(
Substitute(
Expr( __process__ << Set Property("Sigma", __sigma__)),
Expr( __process__ ), Parse( ":" || colNameList[i] ),
Expr( __sigma__ ), theSigma,
)
);
)
);
Thanks again for your quick help.
Ry