cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

How do I get parametrized Process Capability Analysis and Interactive Capability Plot

I would like to have parametrized Process capability, that is the process capability column will be changed by column switcher. However, the process capability analysis definition do not accept any parametrized value. In the following example, let's say the column switcher value is "d" which is a string "Displacement". The Process variables can be defined with Eval(d) without any issue, i.e., Process Variables( Eval(d)) works fine; however, the process capability analysis does not works, i.e, Eval(d)<< Process Capability Analysis does not work. The reason I need this is the columns of the column switcher changes within a list, and I want the interactive plot follows it. 

Another issue I have is the Interactive Capability plot values does not change with the column switcher. Manually, it is possible to use "Revert to Original Values", but it does not work in the script (as shown in the image). How can I use this function in script so that every time I switched the column, it reverts. 

d = "Displacement";
ProcessCap = dt << Process Capability(
	Process Variables( Eval( d ) ),
	Moving Range Method( Average of Moving Ranges ),
	Individual Detail Reports( 1 ),
	Capability Box Plots( 0 ),
	Goal Plot( 0 ),
	Capability Index Plot( 0 ),
	Always use column properties( 1 ),
	Process Performance Plot( 0 ),
	{Eval( d ) << Process Capability Analysis(
		Overall Sigma Capability( 0 ),
		Nonconformance( 0 ),
		Within Sigma Capability( 0 ),
		Histogram( 1, Show Within Sigma Density( 0 ) ),
		Interactive Capability Plot( 1, Revert to original values( 1 ), )
	)},
3 REPLIES 3

Re: How do I get parametrized Process Capability Analysis and Interactive Capability Plot

For "interactive capability plot", there are several ways. For example, you can use "eval insert" as shown below.

dt = Current Data Table();
d = "Displacement";
Eval(
	Parse(
		Eval Insert(
			"\[ProcessCap = dt << Process Capability(
				Process Variables( :^d^ ) ,
				Moving Range Method( Average of Moving Ranges ),
				Individual Detail Reports( 1 ),
				Capability Box Plots( 0 ),
				Goal Plot( 0 ),
				Capability Index Plot( 0 ),
				Always use column properties( 1 ),
				Process Performance Plot( 0 ),
				{:^d^ << Process Capability Analysis(
					Overall Sigma Capability( 0 ),
					Nonconformance( 0 ),
					Within Sigma Capability( 0 ),
					Histogram( 1, Show Within Sigma Density( 0 ) ),
					Interactive Capability Plot( 1, Revert to original values( 1 ), )
				)},
			);
		]\"
		)
	)
);


For other methods, see the following page.

https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Ins... 
I'm not sure if it works to change the interactive capability plot values. I hope it helps.

Re: How do I get parametrized Process Capability Analysis and Interactive Capability Plot

The problem in the above example is before the  "interactive capability plot". It does not evaluate the following:

Eval( d ) << Process Capability Analysis(..........)

The problem is the parametrized "d" calculation. I tried Eval, Parse, Eval Insert functions and none of them worked.

Re: How do I get parametrized Process Capability Analysis and Interactive Capability Plot

Hi @PanelKangaroo44 ,

How about using the substitute function? The following example works for me.

Eval(
	Substitute(
			Expr(
				ProcessCap << {d << Process Capability Analysis(
					Overall Sigma Capability( 0 ),
					Nonconformance( 0 ),
					Within Sigma Capability( 0 ),
					Histogram( 1, Show Within Sigma Density( 0 ) ),
					Interactive Capability Plot( 1, Revert to original values( 1 ), )
				)}
			),
		Expr( d ), Eval( d )
	)
);