Hello,
Since my last question a few days I have come a little further with my script.
To complete the first step I would like to combine the reports (in 3 Windows) in one Report (1 Windows).
How can I do this ... See line 51 ff
And how can I save this Report automaticly named by data_file name (first 10 characters) AND _Baseline (if select more than one Month) OR _Monthly (with selected Month)? ... see line 33-40
my scrpit:
Clear log();
Clear globals();
data_file= Pick File("Select data base");
dt_data= Open( data_file, invisible);
spec_file= Pick File("Select spec file");
dt_spec= Open( spec_file, invisible);
//dt_ssum= New Table("Stat Summary", invisible);
specColName = dt_spec << GetColumnNames( Numeric, String );
dataColName = dt_data << GetColumnNames( Numeric, String );
specExpr = Expr(
Column( dt_data, name ) << set property(
"Spec Limits",
{LSL( Expr( lower ) ), USL( Expr( upper ) )}
);
);
For( i = 1, i <= N Rows( dt_spec ), i++,
name = Column( dt_spec, "Process" );
lower = Column( dt_spec, "LSL" );
upper = Column( dt_spec, "USL" );
If( Contains( dataColName, name ),
Eval( Eval Expr( specExpr ) )
);
);
Current Data Table(dt_data);
New Window( "Select ONE month ", <<Modal,
V List Box(
Text Box("or ALL for baseline"),
mon = List Box(:Stage << get values),
Button Box( "OK", cho = mon << get selected),
)
);
dt_data << Select Where(Contains(cho, :Stage));
if (
cho [1] == "Baseline",
dt_data << delete rows,
dt_data << invert row selection;
dt_data << delete rows;
);
for (k = 1, k <= N Items(dataColName),k++,
cc = dt_data << Control Chart(
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
dataColName,
Individual Measurement( Test 1( 1 ), Test 2( 1 ), Test 3( 1 ) ),
Moving Range,
Capability(
Distribution(
Continuous Distribution(
Column( dataColName),
Quantiles( 0 ),
Horizontal Layout( 0 ),
Histogram( 0 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
Summary Statistics ( 1 ), // no funktion
Normal Quantile Plot( 0 ), // no function
PpK Capability Labeling( 1 ),
Capability Analysis,
)
)
)
),
SendToReport(
Dispatch(
{"Individual Measurement of Assay"},
"IR Chart of IM",
FrameBox( 2 ),
{Frame Size( 75, 162 )}
),
Dispatch(
{"Moving Range of Assay"},
"IR Chart of MR",
FrameBox( 2 ),
{Frame Size( 75, 162 )}
),
Dispatch(
{"Capability Analysis"},
" Long Term Sigma",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{"Capability Analysis"},
" Control Chart Sigma",
)
)
)
);
// create and save new table with LSL, USL, UCL, AVG, LCL,
// Summary Statistics, CP, CPK, CPL, CPU, Sigma (Control Chart Sigma)
ccr = cc << Report;
ccr << show tree structure();
//ccr[StringColBox(1)]
//ccr[NumberColBox(1)]
//ccr[FrameBox(2)]
//ccr[StringColBox(7)]
//ccr[NumberColBox(9)]
//ccr[TextBox(6)]
Thanks for your help