BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
NYorFL
New Contributor

Automate Control Chart with Multiple "Where" Criteria

I have a large data table with multiple columns.  Of these many columns, I specifically want to build a set of Control Charts for "TPeel_Avg" separating out by "SubPad" and "TestQual1".  I know how to build a control chart using Analyze --> Quality and Process --> Control Chart --> IR, but I want to automate this so that I can save it in a Query Builder post-query script.  Whenever I try and copy the scipt which was saved to the subject data table to the Query Builder post-query script I get errors.  Any help?

 

New Window( "RHM_Query 2 - Control Chart",
	V List Box(
		Control Chart(
			Sample Label( :UpdateStamp ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col( :TPeel_Avg, Individual Measurement, Moving Range ),
			Where( :SubPad == "X" & :TestQual1 == "A" )
		),
		Control Chart(
			Sample Label( :UpdateStamp ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col( :TPeel_Avg, Individual Measurement, Moving Range ),
			Where( :SubPad == "X" & :TestQual1 == "B" )
		),
		Control Chart(
			Sample Label( :UpdateStamp ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col( :TPeel_Avg, Individual Measurement, Moving Range ),
			Where( :SubPad == "Y" & :TestQual1 == "A" )
		),
		Control Chart(
			Sample Label( :UpdateStamp ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col( :TPeel_Avg, Individual Measurement, Moving Range ),
			Where( :SubPad == "Y" & :TestQual1 == "B" )
		),
		// ...etc.
	)
)
0 Kudos
3 REPLIES 3
Highlighted
cwillden
Super User

Re: Automate Control Chart with Multiple "Where" Criteria

I don't know if this is where the problem is, but you can really reduce down that script by replacing all those Where() statements with By( :Subpad, :TestQual).  The whole script would be:

New Window( "RHM_Query 2 - Control Chart",
	Control Chart(
		Sample Label( :UpdateStamp ),
		Group Size( 1 ),
		KSigma( 3 ),
		Chart Col( :TPeel_Avg, Individual Measurement, Moving Range ),
		By( :SubPad, :TestQual1 )
	)
)

 

-- Cameron Willden
NYorFL
New Contributor

Re: Automate Control Chart with Multiple "Where" Criteria

That seems to have done the trick!  More of a cosmetic issue for me, but is it possible to now make the X-Axis label angled, similar to:

 

SendToReport(
Dispatch(
{"Individual Measurement of TPeel_Avg"},
"1",
ScaleBox,
{Label Row( Label Orientation( "Angled" ) )}
)
);

?

 

0 Kudos
txnelson
Super User

Re: Automate Control Chart with Multiple "Where" Criteria

Yes you can angle the axis values.  The easiest way to get the syntax of how to do this is to run your original code, right click on the axis and select Axis Settings.  Then from the dialog screen, change the Label Orientation to Angled.  Once this is done, click on OK, and then go to the red triangle and select Save Script.  The script it saves will have the JSL you need to make the changes to the axis.

Jim