cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
NewToThis
Level I

Adding reference lines in variability plot

I have two tables

Table1 is dt=Data Table("Data"); It has columns :WAFER, :STRUCTURE, :PARAMETER and :Value 

Table2 is dtr= Data Table("Targets"); it has columns :PARAMETER, USL, LSL & Target

In one window ( that is active and can be used for point selection or changing legends) I want to have variability charts of all the parameters along with reference lines added (Target, USL, LSL) for each PARAMETER 

if a parameter does not have a target, in the Targets file (dtr) but has data in the DATA file (dt) , the variability plot is created without the reference lines. Otherwise reference lines are added

nw << Append(
	vc = dt << Variability Chart(
		Y(:Normalize Value),
		X(:STRUCTURE, :WAFER),
		Variability Analysis(
			:Value,
			Connect Cell Means(1),
			Std Dev Chart(0),
			Points Jittered(1),
			AIAG Labels(0),
			Show Box Plots(1)
		),
		Where(:Parameter == currentParam),
		SendToReport(
			Dispatch({"Variability Chart for Normalize Value"}, "2", ScaleBox,
				{Add Ref Line(lsl, "Dotted", "Red", "LSL", 2),
				Add Ref Line(target, "Solid", "Black", "Target", 2),
				Add Ref Line(usl, "Dotted", "Red", "USL", 2)}
			)
		)
	)
);

Edit (jthi): added jsl formatting

5 REPLIES 5
jthi
Super User

Re: Adding reference lines in variability plot

Use For Each Row to loop over your targets table (assuming all parameters are there) and create plots in the loop. You can have separate variability chart messages for different cases (limits/no limits). For the limits one, use expression evaluation to add the limits.

-Jarmo
jthi
Super User

Re: Adding reference lines in variability plot

Example

Names Default To Here(1);

dt_limits = New Table("Cities Limits",
	Add Rows(4),
	New Column("Process",
		Character,
		Set Values({"OZONE", "CO", "SO2", "NO"})
	),
	New Column("LSL", Numeric, Set Values([-20, -30, -25, -10])),
	New Column("Target", Numeric, Set Values([5, ., 1, 5])),
	New Column("USL", Numeric, Set Values([20, 30, 10, 25])),
	Set Label Columns(:Process)
);

dt = Open("$SAMPLE_DATA/Cities.jmp");
dt_stack = dt << Stack(
	columns(:OZONE, :CO, :SO2, :NO, :PM10, :Lead),
	Output Table("Stack of Cities (OZONE, CO, SO2, NO, PM10, Lead)")
);
Close(dt, no save);

nw = New Window("",
	vlb = V List Box()
);

For Each Row(dt_limits,
	lowlimit = :LSL;
	highlimit = :USL;
	targetlimit = :Target;
	
	If(Is Missing(targetlimit),
		vlb << Append(dt_stack << Variability Chart(Y(:Data), Model("Main Effect"), X(:city)))
	,
		vlb << Append(Eval(EvalExpr(
			dt_stack << Variability Chart(
				Y(:Data),
				Model("Main Effect"),
				X(:city),
				SendToReport(
					Dispatch(
						{"Variability Gauge Analysis for Data", "Variability Chart for Data"},
						"2", ScaleBox,
						{Add Ref Line(Expr(lowlimit), "Dotted", "Red", "LSL", 2),
						Add Ref Line(Expr(targetlimit), "Solid", "Black", "Target", 2),
						Add Ref Line(Expr(highlimit), "Dotted", "Red", "USL", 2)}
					)
				)
			);
		)));
	);
);

Write();

jthi_1-1769548334611.png

 

-Jarmo
NewToThis
Level I

Re: Adding reference lines in variability plot

Hi Jarmo, 

1. In my case, I want to loop through the PARAMETER in dt which may or may not be present in the dtr. Also there might be more than one row with the same PARAMETER  ( images multiple measurements)

2. In your script, I could not tell which plot is for which Zone. I will need have the name of the variability plot as that of Parameter. 

 

 

NewToThis
Level I

Re: Adding reference lines in variability plot

I used the logic below but having difficulty in adding the limits 

paramList = Associative Array(:Parameter << Get Values) << Get Keys;
For(i = 1, i <= N Items(paramList), i++,
	currentParam = paramList[i]
);

Edit (jthi): added jsl formatting

jthi
Super User

Re: Adding reference lines in variability plot

Which part are you having problems with? Adding limits to associative array? 

-Jarmo

Recommended Articles