我有一个脚本可以导入密封强度数据,然后使用该数据生成控制图。 数据集有近一年的数据,但控制图只需要显示最近 3 个月的数据。脚本中有一个活动封口机编号列表,我将其设置为通过活动封口机列表,如果在过去三个月中有该封口机的数据,则创建一个子集,然后创建控制图。 它正在工作,但是当我最近在列表中添加了两个新的密封器编号(11043 和 12143)时,脚本不会为这两个密封器生成控制图。 我已经手动搜索了数据,并且知道过去三个月中两个新封口机中的每一个都有数据。 我不知道这两个密封剂有什么不同导致脚本出现故障。我在一个 Excel 文件中附加了一些组成的数据,该文件采用我们从密封强度测试中获得的格式。 这是我在脚本中的内容:
//Import file and create data table
DS = Open("Source File Path Here"); //need to check where the file will be stored and what it will be called
DS << Set Name ("Sealer Data - Maximum Load (lbf/in)");
//Sort Data
DS <
//Modify date to display only the date and not the date and time
DS << New Column("Date", Numeric, Continuous, Formula(Short Date(Num(Munger(Char(:End date), 1,10)))));
//Create a subset data table and control chart for each sealer
SL = {07056, 08139, 09066, 10083, 10088, 10532, 11043, 12035, 12036, 12093, 12119, 12143, 12144, 12145, 14122, 14123}; //list modified for 07Feb17
For(i=N Items(SL), i>0, i--,
DS << Select Where (:Sealer Number == SL[i] & :Date >= Short Date(Today() - 90 * 86400));
If( N Row( DS << get selected rows ) == 0, Continue() );
DS << Subset ((Selected Rows), Output Table Name("Sealer_"||char(SL[i])));
IF(SL[i]==12119,
Control Chart(
Sample Label( :Date ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :Maximum Load, Individual Measurement),
SendToReport(
Dispatch( {}, "Control Chart", OutlineBox, {Set Title( "Sealer_"||char(SL[i]) )} ),
Dispatch(
{"Individual Measurement of Maximum Load"},
"2",
ScaleBox,
{Format( "Fixed Dec", 12, 1 ), Min( -0.5), Max( 10 ),
Inc(5), Minor Ticks( 1 ),
Add Ref Line( 0.46, Dashed, "Purple", "0.46" ),
Add Ref Line( 0.7, Dotted, "Blue", "0.70" ),
Rotated Labels( "Horizontal" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"1",
ScaleBox,
{Show Minor Ticks( 0 ), Rotated Labels( "Vertical" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"",
AxisBox,
{Add Axis Label( "Maximum Load (lbf/in)" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"IR Chart of IM",
FrameBox,
{Frame Size( 912, 318 ), Line Width Scale( 1.5 )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"",
AxisBox( 2 ),
{Add Axis Label( "Date" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"IR Chart of IM",
FrameBox( 2 ),
{Frame Size( 70, 318 )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"1",
ScaleBox,
{Inc( 1 ), Minor Ticks( 0 )}
)
),
),
Control Chart(
Sample Label( :Date ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :Maximum Load, Individual Measurement),
SendToReport(
Dispatch( {}, "Control Chart", OutlineBox, {Set Title( "Sealer_"||char(SL[i]) )} ),
Dispatch(
{"Individual Measurement of Maximum Load"},
"2",
ScaleBox,
{Format( "Fixed Dec", 12, 1 ), Min( -0.5 ), Max( 5 ),
Inc( 5 ), Minor Ticks( 1 ), Add Ref Line( 0.46, "Dashed", "Purple", "0.46", 1 ),
Add Ref Line( 0.7, "Dotted", "Blue", "0.70", 1 )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"1",
ScaleBox,
{Inc( 1 ), Minor Ticks( 0 )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"",
AxisBox,
{Add Axis Label( "Maximum Load (lbf/in)" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"IR Chart of IM",
FrameBox,
{Frame Size( 912, 318 ), Line Width Scale( 1.5 )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"",
AxisBox( 2 ),
{Add Axis Label( "Date" )}
),
Dispatch(
{"Individual Measurement of Maximum Load"},
"IR Chart of IM",
FrameBox( 2 ),
{Frame Size( 70, 318 )}
)
)
);
);
);
t 和我将其设置为通过活动密封剂列表,如果在过去三个月中有该密封剂的数据,则创建一个子集,然后创建控制图。 它正在工作,但是当我最近在列表中添加了两个新的密封器编号时,脚本不会为这两个密封器生成控制图。 我已经手动搜索了数据,并且知道过去三个月中两个新封口机中的每一个都有数据。 我不知道这两个密封剂有什么不同导致脚本出现故障。