Hi Jim,
Thanks for that. But its not quite what I was looking for. In the control chart as per below, there are 7 points on which a shift is detected, as indicated by the vertical lines below.
I was then expecting my code below to populate the ReportOut Datatable, with 7 rows of data, with the alarm script running once for each shift detected.
Names Default To Here( 1 );
ReportOutDataTable = New Table( "ReportOut",
//Add Rows(1),
New Column( "Name",
Character,
"Nominal",
)
);
dt = Open( "$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp" );
ReportOUtDataTable = Data Table("ReportOut");
obj = dt << CUSUM Control Chart(
Y( :weight ),
H( 2 ),
Lower Side( 1 ),
Target( 8.1 ),
K( 0.025 ),
Sigma( 0.02 ),
Head Start( 0.05 ),
//Test beyond limits( 1 ),
Alarm Script(
ReportOutDataTable<<Add Rows({:Name="test1"});
),
);
However looks like the alarm script wont run at all, unless Test beyond limits (1) is used. This then results in all points out of control in the chart being circled (71 in my example) , and therefore 71 rows of data being added to my ReportOut Data table.
Ultimately, I want the alarm script to run only when a shift is detected, and then output information on the shift to a ReportOut Data table, with information like the Sample Number on which the shift was detected. Maybe I'm misunderstanding how the Alarm script is indented to function?