cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
GM-FPP
Level II

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

13 REPLIES 13
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 II

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 II

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 II

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

 

 

 

GM-FPP
Level II

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

I thought it would make sense to ask here instead of making a new topic...

 

I have made good process and made an Add-in for our group that is in use.  Trying to learn more, I am looking to add just the "Total Outside" row and only the "Expected Overall PPM" column from the Nonconformance section (underlined in red in the below capture):

GMFPP_0-1728934172331.png

 

I can get the box to show, but no values...  Below is the section of the script (Lines 50-52) for this and a screen capture:

	Report(dist)[Outline Box("Nonconformance"), Table Box(1), String Col Box(1)] << Set Heading("Portion");
	Report(dist)[Outline Box("Nonconformance"), Table Box(1), Number Col Box(1)] << Set Heading("Expected Overall PPM");
	Report(dist)[Outline Box("Nonconformance"), Table Box(1)] << Filter Where(Contains({"Total Outside"}, Expected Overall PPM));

 

 

Notice in the screen capture it also added columns "Expected Within %" and "Expected Overall %", which I do not want.

GMFPP_1-1728999217553.png

 

I know I am missing something basic...  I tried using the properties for the items to compare what is different, but I don't see anything in value.  I also tried the Save Script tool to see if that helps give a clue, but it uses a Dispatch command and I can't get that to work either...

 

Also, is it possible to make the "Noncomformance" section be placed directly under the "Process Summary" and over "Overall Sigma Capability"?  I didn't think so from what I've searched, but I may be missing something there too.

GMFPP_2-1729015745179.png

 

 

Thank you,

Grant

 

 

 

jthi
Super User

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

You can modify the columns you which you wish to show first by using JMP and checking the script JMP creates to see IF JMP can capture what you wish to do (in this case it can). You can then either leave it to the distribution script or move it outside of it.

jthi_0-1729017412478.png

And in your script it could look something like this

Report(dist)[Outline Box("Nonconformance"), NumberColBox("Observed %")] << Visibility("Collapse");
Report(dist)[Outline Box("Nonconformance"), NumberColBox("Expected Within %")] << Visibility("Collapse");
Report(dist)[Outline Box("Nonconformance"), NumberColBox("Expected Overall %")] << Visibility("Collapse");
Report(dist)[Outline Box("Nonconformance"), NumberColBox("Expected Overall PPM")] << Visibility("Visible");
Report(dist)[Outline Box("Nonconformance"), Table Box(1)] << Filter Where(Portion == "Total Outside");

You can also use clone box to "copy" the non-conformance

ncob = Report(dist)[Outline Box("Nonconformance")];
(Report(dist)["Process Capability","? Capability","Process Summary"] << parent) << Append(
	ncob << clone box;
);
(ncob << parent) << Set(0);

jthi_1-1729017828517.png

But if you don't need the functionalities of these JMP platforms, I would consider building custom report from different parts. This way you can control how the report will look like more easily and users won't by accident try to use those features which might not even work properly.

-Jarmo
GM-FPP
Level II

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

Ah!  I'm going to try and wrap my head around your message and mess with it.  I saw the Visibility flags in the Dispatch script (looks the same as what you had), but I didn't grasp how to mesh them like you did.

 

What drove you to use 

Filter Where(Portion == "Total Outside");

and not a list callout like the some of the others.  For example:

Filter Where(Contains({"LSL", "Target", "USL", "N", "Sample Mean"}, Stat))

 

 

Thank you Jarmo!