Publication date: 03/23/2021

Control Charts

Using JSL, you can create control charts, customize tests, run alarm scripts, and more.

Customize Tests in Control Chart Builder

You can design custom tests and select or deselect multiple tests at once using the Customize Tests function. You specify the description, desired number, and label. This option is available only for Variables and Attribute chart types.

The following example creates a custom test called Test 1 and turns it on.

dt = Open( "$SAMPLE_DATA/Quality Control/" );
dt << Control Chart Builder(
	Variables( Subgroup( :DAY ), Y( :DIAMETER ) ),
	Customize Tests( Test 1( 2, "1" ) ), // test number, n, label
	Chart( Position( 1 ), Warnings( Test 1( 1 ) ) ), // turn Test 1 on
	Chart( Position( 2 ) )

Run Alarm Scripts

An alarm script alerts you when the data fail one or more tests. As an Alarm Script is invoked, the following variables are available, both in the issued script and in subsequent JSL scripts:

qc_col is the name of the column

qc_test is the test that failed

qc_sample is the sample number

qc_phase is the label of the phase during which the failure occurred

qc_firstRow is the first row in the sample

qc_lastRow is the last row in the sample

Example 1: Automatically Writing to a Log

One way to generate automatic alarms is to make a script and store it with the data table as a data table script or column property named QC Alarm Script.

The following example automatically writes a message to the log whenever a test fails:

dt = Open( "$SAMPLE_DATA/Quality Control/" );
obj = dt << Control Chart(
	Sample Size( :Sample ),
	KSigma( 3 ),
	Chart Col( :Weight, XBar, R ),
	Alarm Script(
			"Out of Control for test ",
			" in column ",
			" in sample ",
obj << Test 1( 1 );

Example 2: Running a Chart with Spoken Tests

You can create a control chart with tests that are spoken aloud using the Speak function. Try the following example:

dt = Open( "$SAMPLE_DATA/Quality Control/" );
dt << Control Chart(
	Alarm Script(
			Match( QC_Test,
				1, "One point beyond Zone A",
				QC_Test, 2,
				"Nine points in a row in zone C or beyond", QC_Test,
					"Two out of three points in a row in Zone A
					or beyond"
	Sample Size( :Sample ),
	Ksigma( 3 ),
	Chart Col( :Weight, Xbar( Test 1( 1 ), Test 2( 1 ), Test 5( 1 ) ), R )

You can have either of these scripts use any of the JSL alert commands, such as Speak, Write, or Mail.

Set Phase Limits

A phase is a group of consecutive observations in the data table. For example, phases might correspond to time periods during which a new process is brought into production and then put through successive changes. Phases generate, for each level of the specified Phase variable, a new sigma, set of limits, zones, and resulting tests.

The following example illustrates setting the limits for the different phases of

dt = Open( "$SAMPLE_DATA/Quality Control/" );
dt << Control Chart(
	Phase( :Phase ),
	Sample Size( :DAY ),
	KSigma( 3 ),
	Chart Col(
			Phase Level(
				Sigma( .29 ),
				Avg( 4.3 ),
				LCL( 3.99 ),
				UCL( 4.72 )
			Phase Level(
				Sigma( .21 ),
				Avg( 4.29 ),
				LCL( 4 ),
				UCL( 4.5 )
		R( Phase Level( "1" ), Phase Level( "2" ) )
Want more information? Have questions? Get answers in the JMP User Community (