cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
GM-FPP
Level I

Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

Hi.  I am very new.  Before I jump into learning Scripting, I would like to get a confirmation I am approaching this correctly.  We want an easy way to create the below simple Distribution report that can be created for a user selected column, typically 30 data points, that looks like the below pic and we are hoping to remove the items with red lines:

ReportForAnyColumn.png

An example of a data table is: 

DataTable.PNG

 

Below is the script the system created when I used: Save Script/To Data Table:

 

Distribution(
Continuous Distribution(
Column( :OD ),
Horizontal Layout( 1 ),
Histogram( 0 ),
Vertical( 0 ),
Process Capability(
Use Column Property Specs,
Process Capability Analysis( Nonconformance( 0 ) )
)
),
Histograms Only,
SendToReport(
Dispatch( {"OD", "Process Capability", "OD Capability", "Histogram"}, "1",
ScaleBox,
{Min( 2.1388234375 ), Max( 2.1636765625 ), Inc( 0.005 ),
Minor Ticks( 5 )}
)
)
);

 

I am assuming this cannot be done without scripting.  If that is not true, please let me know.

 

What I am planning on doing is trying to learn how to script so the user can select the Column to use, where the above script only uses column "OD".  This would, hopefully, give the basic report above by running the script.

 

Then start looking for script changes to remove the entries that we have crossed out in red.

 

Is this approach naive?  Is there a better way to approach it?

 

Thank you for any input,

Grant

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

You can build something like this using Workflow builder, so depending on what you are doing utilizing that might be a good idea (and it is good practice on using JMP).

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

run_custom_dist = Expr(
	vlb = V List Box(
		dist = dt << Distribution(
			Ignore Platform Preferences(1),
			Continuous Distribution(
				Column(Eval(mycol)),
				Quantiles(0),
				Summary Statistics(0),
				Horizontal Layout(1),
				Histogram(0),
				Vertical(0),
				Outlier Box Plot(0),
				Process Capability(Use Column Property Specs, Process Capability Analysis(Nonconformance(0)))
			)
		),
		ccb = dt << Control Chart Builder(
			Show Two Shewhart Charts(0),
			Include Missing Categories(0),
			Show Limit Summaries(0),
			Show Capability(0),
			Variables(Y(Eval(mycol))),
			Chart(Points(Statistic("Moving Range")), Limits(Sigma("Moving Range"))),
			Show Control Panel(0)
		)
	);	
	// modify axis
	Report(dist)[Outline Box("Histogram"), AxisBox(1)] << Min(100) << Max(130) << Inc(1) << Minor Ticks(5);

	// Filter table boxes
	Report(dist)[Outline Box("Within Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Cpk", "Cp"}, Index));
	Report(dist)[Outline Box("Overall Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Ppk", "Pp"}, Index));

	Report(dist)[Outline Box("Process Summary"), Table Box(1), String Col Box(1)] << Set Heading("Stat");
	Report(dist)[Outline Box("Process Summary"), Table Box(1), Number Col Box(1)] << Set Heading("Value");
	Report(dist)[Outline Box("Process Summary"), Table Box(1)] << Filter Where(Contains({"LSL", "Target", "USL", "N", "Sample Mean"}, Stat));
	
	nw = new window("",
		vlb
	);
);

nw = New Window("UI",
	H List Box(
		Panel Box("Pick Columns",
			window:fcs = Filter Col Selector(dt, << Character(0))
		),
		Panel Box("Cast",
			Lineup Box(N Col(2),
				Button Box("Column", << Set Function(function({this},
					(this << sib) << Append(window:fcs << get selected)
				))),
				window:clb = Col List Box(dt, Min Items(1), Max items(1), N Lines(2), << Modeling Type({"Continuous"}))
			)
		),
		Panel Box("Actions",
			Lineup Box(N Col(1),
				Button Box("OK",
					sel = window:clb << get items;
					If(N Items(sel) > 0,
						mycol = sel[1];
						run_custom_dist;
						window:fcs << close window;
					);
				),
				Button Box("Cancel", window:fcs << close window);
			)
		)
		
	)
);

Write();

How something like this should be used is totally up to you, for me it would maybe make most sense to have a workflow for this (fixing the distribution could be a bit difficult without JSL for workflow though) OR create an add-in which user could run on their own table as needed. For add-in purposes I would most likely let user select more than one column or utilize column switcher and it would be a good idea to implement some extra checks (is table open, do the selected columns have spec limits and so on).

 

Edit: Fixed hard-coded value from Control Chart Builder

-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

For capability tables this is fairly easy as you can use filter such as

Contains({"Cpk", "Cp"}, Index)

But this does not work for the table box below Process Summary as it doesn't have column names... so you cannot easily utilize Presets for example. 

 

So utilize scripting. With scripting you can add those headers to the table box and then use them for filtering

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

mycol = "NPN1";

dist = dt << Distribution(
	Ignore Platform Preferences(1),
	Continuous Distribution(
		Column(Eval(mycol)),
		Quantiles(0),
		Summary Statistics(0),
		Horizontal Layout(1),
		Histogram(0),
		Vertical(0),
		Outlier Box Plot(0),
		Process Capability(
			Use Column Property Specs,
			Process Capability Analysis(Nonconformance(0))
		)
	)
);

// modify axis
Report(dist)[OutlineBox("Histogram"), AxisBox(1)] << Min(100) << Max(130) << Inc(1) << Minor Ticks(5);

// Filter table boxes
Report(dist)[OutlineBox("Within Sigma Capability"), TableBox(1)] << Filter Where(Contains({"Cpk", "Cp"}, Index));
Report(dist)[OutlineBox("Overall Sigma Capability"), TableBox(1)] << Filter Where(Contains({"Ppk", "Pp"}, Index));

Report(dist)[OutlineBox("Process Summary"), TableBox(1), StringColBox(1)] << Set Heading("Stat");
Report(dist)[OutlineBox("Process Summary"), TableBox(1), NumberColBox(1)] << Set Heading("Value");
Report(dist)[OutlineBox("Process Summary"), TableBox(1)] << Filter Where(Contains({"LSL", "Target", "USL", "N", "Sample Mean"}, Stat));

 

jthi_1-1728449724873.png

 

-Jarmo
GM-FPP
Level I

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

Thank you, Jarmo, for taking the time to do that.  That gives me a great foundation to apply to our table.  I am grateful for your help.

 

I'll play around with it and see if I can figure out if I can do a user prompt for the target column, as the name varies, and build on that.  At the very least I can customize the script for certain part scenarios with my current (limited) knowledge.  For our users that may even be better for them.  Anway, thank you again.

jthi
Super User

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

After you get going with JSL, creating simple UI for something like this is fairly simple (even more so if you use Column Dialog() but I don't personally like that). This example does contain some more advanced techniques but will do most likely what you want to do. There are some sanity checks which you might want to add, such as checking for spec limits but something like this can serve as starting point

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

run_custom_dist = Expr(		
	dist = dt << Distribution(
		Ignore Platform Preferences(1),
		Continuous Distribution(
			Column(Eval(mycol)),
			Quantiles(0),
			Summary Statistics(0),
			Horizontal Layout(1),
			Histogram(0),
			Vertical(0),
			Outlier Box Plot(0),
			Process Capability(Use Column Property Specs, Process Capability Analysis(Nonconformance(0)))
		)
	);

	// modify axis
	Report(dist)[Outline Box("Histogram"), AxisBox(1)] << Min(100) << Max(130) << Inc(1) << Minor Ticks(5);

	// Filter table boxes
	Report(dist)[Outline Box("Within Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Cpk", "Cp"}, Index));
	Report(dist)[Outline Box("Overall Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Ppk", "Pp"}, Index));

	Report(dist)[Outline Box("Process Summary"), Table Box(1), String Col Box(1)] << Set Heading("Stat");
	Report(dist)[Outline Box("Process Summary"), Table Box(1), Number Col Box(1)] << Set Heading("Value");
	Report(dist)[Outline Box("Process Summary"), Table Box(1)] << Filter Where(Contains({"LSL", "Target", "USL", "N", "Sample Mean"}, Stat));
);

nw = New Window("UI",
	H List Box(
		Panel Box("Pick Columns",
			window:fcs = Filter Col Selector(dt, << Character(0))
		),
		Panel Box("Cast",
			Lineup Box(N Col(2),
				Button Box("Column", << Set Function(function({this},
					(this << sib) << Append(window:fcs << get selected)
				))),
				window:clb = Col List Box(dt, Min Items(1), Max items(1), N Lines(2), << Modeling Type({"Continuous"}))
			)
		),
		Panel Box("Actions",
			Lineup Box(N Col(1),
				Button Box("OK",
					sel = window:clb << get items;
					If(N Items(sel) > 0,
						mycol = sel[1];
						run_custom_dist;
						window:fcs << close window;
					);
				),
				Button Box("Cancel", window:fcs << close window);
			)
		)
		
	)
);

Write();

Scripting Guide is good source for getting started with JSL

-Jarmo
GM-FPP
Level I

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

Thank you Jarmo!  I have started with the Scripting Guide.  I probably am not being patient enough, but I am continuing to work through it. 

 

Could I ask you to show one more change?  I think it will help me a lot.  Could you add to the script so a moving average chart would be added below the Sigma Capabilities (basically at the bottom)?  I did an example below with the NPN1 from the Semiconductor file.  I am missing something in the script callouts and I think it will help me understand it.

MovingRange.PNG

 

I can imagine you are going to roll your eyes <g> as this next question shows fundamentally that I don't understand JMP well.  Does a script like this make more sense to be a script file that a user opens and runs or does it make more sense to save this script into the data table and run from there?  Is it just preference or is there some advantage?

 

If there is some other way to acknowledge your help besides a Kudo, please let me know.  You're help has saved me a lot of headaches.

 

Thank you again,

Grant

jthi
Super User

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

You can build something like this using Workflow builder, so depending on what you are doing utilizing that might be a good idea (and it is good practice on using JMP).

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

run_custom_dist = Expr(
	vlb = V List Box(
		dist = dt << Distribution(
			Ignore Platform Preferences(1),
			Continuous Distribution(
				Column(Eval(mycol)),
				Quantiles(0),
				Summary Statistics(0),
				Horizontal Layout(1),
				Histogram(0),
				Vertical(0),
				Outlier Box Plot(0),
				Process Capability(Use Column Property Specs, Process Capability Analysis(Nonconformance(0)))
			)
		),
		ccb = dt << Control Chart Builder(
			Show Two Shewhart Charts(0),
			Include Missing Categories(0),
			Show Limit Summaries(0),
			Show Capability(0),
			Variables(Y(Eval(mycol))),
			Chart(Points(Statistic("Moving Range")), Limits(Sigma("Moving Range"))),
			Show Control Panel(0)
		)
	);	
	// modify axis
	Report(dist)[Outline Box("Histogram"), AxisBox(1)] << Min(100) << Max(130) << Inc(1) << Minor Ticks(5);

	// Filter table boxes
	Report(dist)[Outline Box("Within Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Cpk", "Cp"}, Index));
	Report(dist)[Outline Box("Overall Sigma Capability"), Table Box(1)] << Filter Where(Contains({"Ppk", "Pp"}, Index));

	Report(dist)[Outline Box("Process Summary"), Table Box(1), String Col Box(1)] << Set Heading("Stat");
	Report(dist)[Outline Box("Process Summary"), Table Box(1), Number Col Box(1)] << Set Heading("Value");
	Report(dist)[Outline Box("Process Summary"), Table Box(1)] << Filter Where(Contains({"LSL", "Target", "USL", "N", "Sample Mean"}, Stat));
	
	nw = new window("",
		vlb
	);
);

nw = New Window("UI",
	H List Box(
		Panel Box("Pick Columns",
			window:fcs = Filter Col Selector(dt, << Character(0))
		),
		Panel Box("Cast",
			Lineup Box(N Col(2),
				Button Box("Column", << Set Function(function({this},
					(this << sib) << Append(window:fcs << get selected)
				))),
				window:clb = Col List Box(dt, Min Items(1), Max items(1), N Lines(2), << Modeling Type({"Continuous"}))
			)
		),
		Panel Box("Actions",
			Lineup Box(N Col(1),
				Button Box("OK",
					sel = window:clb << get items;
					If(N Items(sel) > 0,
						mycol = sel[1];
						run_custom_dist;
						window:fcs << close window;
					);
				),
				Button Box("Cancel", window:fcs << close window);
			)
		)
		
	)
);

Write();

How something like this should be used is totally up to you, for me it would maybe make most sense to have a workflow for this (fixing the distribution could be a bit difficult without JSL for workflow though) OR create an add-in which user could run on their own table as needed. For add-in purposes I would most likely let user select more than one column or utilize column switcher and it would be a good idea to implement some extra checks (is table open, do the selected columns have spec limits and so on).

 

Edit: Fixed hard-coded value from Control Chart Builder

-Jarmo
GM-FPP
Level I

Re: Newbie how to approach customize Histogram, Sigma Capability, and Process Summary

Jarmo, thank you.  That gives me a great foundation to start working towards.  I have been modifying that code and it really is helping.  Seeing that new window code really helped something I was missing.

 

I will also work through that Workflow builder.  I had not looked at that at all yet.  Ultimately, from what I know now, an Addin seems like it would be best for our group, once I get there...

 

Again, I really appreciate all your help and can't thank you enough,

Grant