cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Neo
Neo
Level VI

Custom Group By Distribution Plots

I have two column data. Column1 is measured data from parts and Column2 lists Pass or Fail. I would like to plot the full distribution (Pass + Fail) for all the measured data and then stack below it distribution of only passing (Pass) parts. How, to get this working (JSL script would be fine but I would also like to know if this could be done interactively)?

 

At the moment, I find myself only able to group by Column2 in Distribution plot option and get a distribution for Fails and below it distribution for Pass (when stacked one below the other). 

 

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions
Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

Simples...

 

New Window("My Report",

Distribution(
	Stack( 1 ),
	Continuous Distribution(
		Column( :Col1),
		Horizontal Layout( 1 ),
		Vertical( 0 )
	)
);

Distribution(
	Stack( 1 ),
	Automatic Recalc( 1 ),
	Continuous Distribution(
		Column( :Col1),
		Horizontal Layout( 1 ),
		Vertical( 0 )
	),
	Local Data Filter(
		Close Outline( 1 ),
		Add Filter( columns( :Col2), Where( :Col2== "PASS" ) )
	)
);
);
When it's too good to be true, it's neither

View solution in original post

8 REPLIES 8
tom_abramov
Level V

Re: Custom Group By Distribution Plots

Copy column1 to column1_copy

Create distribution for both column1 and column1_copy

Add Local Data Filter of column2 for both of them (for column1 is not necessary but for simmetry of the charts will be nice)

Choose Pass only in the local data filter of column1_copy

 

Hope it helps.

BR,

Tom

 

Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

Thanks @tom_abramov. I should have specified. I am looking for a solution without changing the data table.

When it's too good to be true, it's neither

Re: Custom Group By Distribution Plots

You can build this interactively as a dashboard. This approach will also generate the script you would need if you want that.

 

Create your distribution of Column1.

Now Create another distribution of Column1, but add a Local Data Filter that is using Column2. Select the Pass group so that this report window now displays just the Pass observations. I would then collapse the Local Data filter area, but that is up to you.

 

In the lower-right of each of those report windows, check the box. Now from that same area, click the down arrow and choose to Combine Windows. This will give you both reports in one window, but they are arranged horizontally. Click the filtered report, and drag it to below the non-filtered report.

 

I think this will give you everything that you need.

Dan Obermiller
Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

Thanks @Dan_Obermiller . This works and very useful trick to know. However, running the saved script does not reproduce the distribution charts one below the other. They still appear side by side. How to fix this?

When it's too good to be true, it's neither

Re: Custom Group By Distribution Plots

I had not noticed that the script did not vertically arrange the plots. In that case I think that you will need to modify the script by putting in the appropriate VListBox to put the graphics into.

Dan Obermiller
Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

@Dan_Obermiller . I do not see a JSL script inside when the combined chart is saved. It gives itself a default name of "Dashboard" which  when opened shows two charts inside. Where am I going wrong?

When it's too good to be true, it's neither
Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

Here are my two scripts for full distribution and "pass" distribution respectively. Is there no simple way to put them in one chart one below the other via JSL?

Distribution( Continuous Distribution( Column( :Col1) ) );
Distribution(
	Automatic Recalc( 1 ),
	Continuous Distribution( Column( :Col1 ) ),
	Local Data Filter(
		Close Outline( 1 ),
		Add Filter( columns( :Col2), Where( :Col2 == "PASS" ) )
	)
);
When it's too good to be true, it's neither
Neo
Neo
Level VI

Re: Custom Group By Distribution Plots

Simples...

 

New Window("My Report",

Distribution(
	Stack( 1 ),
	Continuous Distribution(
		Column( :Col1),
		Horizontal Layout( 1 ),
		Vertical( 0 )
	)
);

Distribution(
	Stack( 1 ),
	Automatic Recalc( 1 ),
	Continuous Distribution(
		Column( :Col1),
		Horizontal Layout( 1 ),
		Vertical( 0 )
	),
	Local Data Filter(
		Close Outline( 1 ),
		Add Filter( columns( :Col2), Where( :Col2== "PASS" ) )
	)
);
);
When it's too good to be true, it's neither