Data values violating the selected run rules are identified in the control chart; how can I get those points labeled or identified in the data table other than by clicking on them in the charts? How can I tell JMP to label the corresponding row numbers in the data table or in a list?
Thanks
It turns out that the method above is not required since (from JMP 12) Control Chart Builder can do what's required via the summary table it generates:
NamesDefaultToHere(1);
// Make a chart from dt1 using Control Chart Builder
dt1 = Open("$Sample_Data/Quality Control/Coating.jmp");
ccb = dt1 << Control Chart Builder(
Variables( Subgroup( :Sample ), Y( :weight ) ),
Chart(
Position( 1 ),
Warnings(
Test 1( 1 ),
Test 2( 1 ),
Test 3( 1 ),
Test 4( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Test 7( 1 ),
Test 8( 1 )
)
),
Chart( Position( 2 ) )
);
// Save summaries to a new table dt2
dt2 = ccb << SaveSummaries;
// Rule violations occur in dt2 in the column "Test Failures" as comma delimited text ("" if no violations)
dt2 << SelectWhere(:Test Failures != "");
Not particularly elegant, but you can coerce the 'Alarm Script()' to do this using the approach below (for details of the 'Alarm Script()' see the 'Scripting Guide' under 'Help > Books'):
NamesDefaultToHere(1);
ClearLog(); // Required beacuse we need to 'scrape' the contents of the log window (see below)
// Make a sample data table. Because the data generated is perfectly 'in control' we may need lots of samples
ss = 5; // Sample Size
ns = 500; // Number of Samples
sv = SortAscending(Repeat((1::ns)`, ss));
dt = NewTable("Using an Alarm Script Retrospectively",
NewColumn("Weight", Numeric, Continuous, Formula(RandomNormal(0, 1))),
NewColumn("Sample", Numeric, Continuour, Values(sv))
);
// Make an XBar - R chart, and apply three of the tests to flag out of control conditions
dt << Control Chart(
// Note that the alarm script HAS TO APPEAR FIRST inside 'ControlChart()'!
Alarm Script( Write("--->Failing Rule Number: ", QC_Test, " Sample Number: ", QC_Sample, " Sample start row: ", QC_FirstRow, " Sample end row: ", QC_LastRow, "\!N") ),
Chart Col( :Weight, Xbar( Test 1( 1 ), Test 2( 1 ), Test 5( 1 ) ), R ),
Sample Size( :Sample ),
Ksigma( 3 )
);
// The alarm script only gives options to 'Speak', 'Write' (to the log and used above) or 'Email', because as the name implies, it is intended for real time
// use. To use it retrospectively, the best way is to 'scrape' the necessary values from the log window . . .
txt = GetLog(); // txt is a list, with (text) items corresponding to each row in the log window
// This code selects all rows in dt that are associated with an out of control flag . . .
rows2select = [];
for (a=1, a<=NItems(txt)-1, a++,
wordsInLine = Words(txt[a], " ");
if(wordsInLine[1] == "--->Failing",
sampleStartRow = Num(wordsInLine[11]);
sampleEndRow = Num(wordsInLine[15]);
rows2select = VConcat(rows2select, (sampleStartRow::sampleEndRow)`)
);
);
dt << selectRows(rows2select);
It turns out that the method above is not required since (from JMP 12) Control Chart Builder can do what's required via the summary table it generates:
NamesDefaultToHere(1);
// Make a chart from dt1 using Control Chart Builder
dt1 = Open("$Sample_Data/Quality Control/Coating.jmp");
ccb = dt1 << Control Chart Builder(
Variables( Subgroup( :Sample ), Y( :weight ) ),
Chart(
Position( 1 ),
Warnings(
Test 1( 1 ),
Test 2( 1 ),
Test 3( 1 ),
Test 4( 1 ),
Test 5( 1 ),
Test 6( 1 ),
Test 7( 1 ),
Test 8( 1 )
)
),
Chart( Position( 2 ) )
);
// Save summaries to a new table dt2
dt2 = ccb << SaveSummaries;
// Rule violations occur in dt2 in the column "Test Failures" as comma delimited text ("" if no violations)
dt2 << SelectWhere(:Test Failures != "");