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

Scripting Control Chart for Selected Items from the Process Screening Module

I have been working to automate a Process Screening Analysis.
I have a textbox popup which prompts the user to put in a date in the yyyy-mm format. Then I have a button to save the date as a variable. Next, I have a button which runs the Process Screening Analysis. In addition to that, I put in a local data filter using the user input to do the analysis on only that set of the data. This works fine.

However, I also want to take advantage of the Control Chart for Selected Items option which I put as the last argument of the Process Screening module. The second to last argument is Select All. The result I get shows the Control Charts with the correct grouping but not the correct filtering (all data from the data table is used to create the charts).

I have two questions. How can I make sure only the data that has been filtered by the Local Data Filter be used to create the charts?
(If I create the charts I want using the red triangle from the Process Screening module and then grab that script I will end up with a lot of hardcoded values which might not work for a later analysis)

Second question is how can I recall the control charts for further processing or saving? I have not been able to figure out how to save them to another variable or export them. Earlier I save the process screening analysis to a variable and then use << report; and save as a powerpoint but only the process screening shows up without the control charts.

Any help or resources would be appreciated.

Here is snipped of my code

year = Char( Year( Today() ) );
month = Char( Month( Today() ) );
date = Concat Items( {year, month}, "-" );

w = New Window( "Date Filter", 
	Border Box( top( 30 ), bottom( 20 ), Left( 30 ), Right( 30 ), 
		V List Box( 
			H Center Box( Text Box( "Date Filter\!n\!nPlease enter date in yyyy-mm format" ) ),
			Spacer Box( size( 1, 30 ) ), 
			H List Box( Text Box( "Date: " ), b1 = Text Edit Box( date ) ), 
			Spacer Box( size( 1, 15 ) ), 
			Spacer Box( size( 1, 15 ) ), 
			H Center Box( 
				Button Box( "Save Filter Date",
					b2 = b1 << Get Text();
				)
			),
			H Center Box(
				Button Box( "Get Process Capability",
					Current Data Table( dt2 );
					dt4 = Process Screening(
						Process Variables(
							:"Metric1", :"Metric2",:"Metric3"),
							Grouping( :"MetricA" ),
							Control Chart Type( "Indiv and MR" ),
							Process Performance Graph( 1 ),
							Show Tests( 0 ),
							Target Index( 1 ),
							Cp( 1 ),
							Spec Limits( 1 ),
							Use Limits Table(1,Data Table( dt3 ),Process Variables( :Process ),Grouping( :"MetricA" ),LSL( :LSL ),USL( :USL ),Target( :Target ),Go),
						Local Data Filter(Add Filter( columns( :"ProcessDate" ), Where(:"ProcessDate" == b2 ))),
						SendToReport( Dispatch( {}, "", TableBox, {Sort By Column( 2, 1 )} ) ),
						Select All,
						Control Charts for Selected Items,

					);
				)
			)
		)
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Scripting Control Chart for Selected Items from the Process Screening Module

This seems to be at least working

Names Default To Here(1);

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

ps = dt << Process Screening(
	Process Variables(
		:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1,
		:INM1
	),
	Control Chart Type("Indiv and MR"),
	RowStates([0 1, 10 1, 11 1]),
	Local Data Filter(
		Add Filter(
			columns(:lot_id),
			Where(:lot_id == {"lot01", "lot02", "lot03", "lot04"}),
			Display(:lot_id, N Items(13))
		)
	)
);

ps << Select All;
ps << Control Charts for Selected Items;
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Scripting Control Chart for Selected Items from the Process Screening Module

Is your filter working correctly for process screening? I did simple test using jmps sample data.

Filtered to only lot01

jthi_0-1729317383636.png

and when I create control chart for selected I can see it has been filtered

jthi_1-1729317406807.png

 

The control charts will open in a new window. To capture that you can use << get window list + << get window title and check which is your window. It is named "Selected Charts" if more than one is created AND "Selected Charts" doesn't yet exist

-Jarmo

Re: Scripting Control Chart for Selected Items from the Process Screening Module

Hello jthi,

Yes the local data filter is definitely working correctly for the process capability portion of the analysis. If I have the data filtered and select the metrics I want (which is all) and then go to the red triangle and select Control Charts for selected items then I get the filtered control chart which is what I am looking for. If I keep using my code as pasted above the unfiltered (all data) control charts are outputted.

jthi
Super User

Re: Scripting Control Chart for Selected Items from the Process Screening Module

This seems to be at least working

Names Default To Here(1);

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

ps = dt << Process Screening(
	Process Variables(
		:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1,
		:INM1
	),
	Control Chart Type("Indiv and MR"),
	RowStates([0 1, 10 1, 11 1]),
	Local Data Filter(
		Add Filter(
			columns(:lot_id),
			Where(:lot_id == {"lot01", "lot02", "lot03", "lot04"}),
			Display(:lot_id, N Items(13))
		)
	)
);

ps << Select All;
ps << Control Charts for Selected Items;
-Jarmo

Re: Scripting Control Chart for Selected Items from the Process Screening Module

Yes this seems to work. Thank you for the help