I have 2 files, "spec" and "Data". The data has FAI, and Points (PT). I want to run a Analysis -> Quality Process -> Variability chart and automatically apply the spec for each FAI to the charts.
On some occasions i can get the Limits array to apply using below code but it is inconsistent
If i change the limits to a static value, it would work fine.
1) I'm looking for any help the community can provide
2) If there are more elegant solution, i'm also would like to know.
Example Code Below
=====================
close all (data tables, nosave); clear symbols(); delete symbols();
// Create stacked Data Table: these are just examples, i know how to read as a file
dtDataStacked = new table ("dtDataStacked");
dtDataStacked << New Column("FAI",Character,values({"01","02","02","03","03","03"}));
dtDataStacked << New Column("PT",Character,values({"A","A","B","A","B","B"}));
dtDataStacked << New Column("Value",values({1,1,2,1,2,3}));
dtSpecStacked = new table ("dtSpecStacked");
dtSpecStacked << New Column("_FAI",Character,values({"01","02","03"}));
dtSpecStacked << New Column("_LSL",numeric,Continious,values({0,0,0}));
dtSpecStacked << New Column("_USL",numeric,Continious,values({4,4,4}));
// assign limits to stackedData
dtDataStacked << update(
with (dtSpecStacked),
Match Columns(FAI = _FAI)
);
// Making Plots
current data table (dtDataStacked);
dtDataStacked << Variability Chart(
Y( :Value ),
X( :PT ),
By( :FAI),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
Show Box Plots( 1 ),
SendToReport(
Dispatch(
{"Variability Chart for Value"},
"2",
ScaleBox,
{
// Add Ref Line( {0, 4}, "Solid", "Dark Green","", 1, 0.25 ) // this line works
Add Ref Line( {_lsl, _usl}, "Solid", "Dark Green","", 1, 0.25 ) /// this line does not
}
)
)
);