cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
jevanove
New Member

Using Configuration Columns to Selectively Apply Rules to Control Charts

Hello,

 

I am having an issue applying the apropriate trend rules, or "Tests", to control charts using JSL. My data consists on the results of multiples analyses for all the measures lots of a certain product in the last year. The data I am working with is in a stacked format, and the table has columns which contain control and specification limits, as well as 8 columns for all 8 Tests. In the tests columns, each row will have either a 1 or a 0 to indicate if the rule will apply. I have set up a sample table below in a similar format for reference.

 

Lot IDAnalysisResultLCLUCLRule1Rule3Rule5
AX121018100
AY204200215101
AZ0.80.51111
BX131018100
BY209200215101
BZ0.70.51111
CX151018100
CY205200215101
CZ0.80.51111

 

In this example, there are 3 unique analyses for 3 unique lots. The Result column is unique for each analysis of each lot, but the control limits and trend rules are matched for matching analyses, so for analysis X, only Rule 1 should apply, but for Analysis Z, all 3 rules should apply. I have control charts being plotted using the code below, with minor modifications to column names for the sake of the example:

 

dt << Control Chart(
	Sample Label( :Lot ),
	Group Size( 1 ),
	KSigma( 3 ),
	By( :Analysis ),
	Chart Col( :Result, Levey Jennings( Show Zones( 1 ), Shade Zones( 1 ), Test 1( :Rule1[1] ), Test 3( :Rule3[1] ), Test 5( :Rule5[1] ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Levey Jennings of Result",
			OutlineBox,
			{Set Title("Parameter: "||char(:Analysis))}
		),

The rest of the code is Dispatch commands to add reference lines, adjust the frame size, etc. Those sections of code are not having issues, so I have omitted them for brevity. As shown above, when adding in the "Test 1", "Test 3" and "Test 5" lines to the Levey Jennings command, I attempted to reference the value of the first row from the respective configuration columns. This way, as the script plots the charts by Analysis, the first row will contain the Trend Rule configuration of the current analysis being plotted. However, when I run the script, it just applies all 3 rules, regardless of if they should be applied for that specific parameter. Can someone help explain how I can get JMP to parse the value from the respective configuration columns and determine if a certain rule should be applied to each chart by Analysis?

 

I have previously made this work in a split table, but I did so by using a for loop to create a string with the values concatenated into the string, then using the Parse and Eval commands to execute. I'd really prefer not to use a for loop here if it can be avoided, as this is why I am pulling the data in a stacked format in the first place.

1 REPLY 1
txnelson
Super User

Re: Using Configuration Columns to Selectively Apply Rules to Control Charts

I ran your JSL with 2 modifications

  1. You specified a column called Lot and the actual name is Lot ID
  2. I removed the Send to Report section
Names Default To Here( 1 );
dt = Current Data Table();
dt << Control Chart(
	Sample Label( :Lot ID ),
	Group Size( 1 ),
	KSigma( 3 ),
	By( :Analysis ),
	Chart Col(
		:Result,
		Levey Jennings(
			Show Zones( 1 ),
			Shade Zones( 1 ),
			Test 1( :Rule1[1] ),
			Test 3( :Rule3[1] ),
			Test 5( :Rule5[1] )
		)
	);

The code ran and produced the following output

txnelson_0-1732158709087.png

To verify that the tests specified were properly handled, I saved the script from the Control Chart output


Control Chart(
	SendToByGroup( {:Analysis == "X"} ),
	Sample Label( :Lot ID ),
	KSigma( 3 ),
	SendToByGroup(
		{:Analysis == "X"},
		Chart Col(
			:Result,
			Levey Jennings( Show Zones( 1 ), Shade Zones( 1 ), Test 1( 1 ) )
		)
	),
	SendToByGroup(
		{:Analysis == "Y"},
		Chart Col(
			:Result,
			Levey Jennings(
				Show Zones( 1 ),
				Shade Zones( 1 ),
				Test 1( 1 ),
				Test 5( 1 )
			)
		)
	),
	SendToByGroup(
		{:Analysis == "Z"},
		Chart Col(
			:Result,
			Levey Jennings(
				Show Zones( 1 ),
				Shade Zones( 1 ),
				Test 1( 1 ),
				Test 3( 1 ),
				Test 5( 1 )
			)
		)
	),
	By( :Analysis )
);

As can be seen in the generated script, the Control Chart received the information on what tests to run for each Analysis

I ran the code on Windows 11 with JMP 18.1.0

I don't see an issue

Jim