cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Hegedus1
Level III

How to connect column switcher and local data filter together

Hi,

Here is my not quite working script.

test = Fit Group(
	Oneway(
		Y( :Max Discharge Capacity ),
		X( :Cathode Recipe.x ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),
		
	),
	
	Oneway(
		Y( :"Cycle Number (>0.3)"n ),
		X( :Cathode Recipe.x ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),
		
	),
	Oneway(
		Y( :"Discharge Capacity @ 50 Cycles"n ),
		X( :Cathode Recipe.x ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),
	),
	Oneway(
		Y( :"Remain % @ 50 Cycles"n ),
		X( :Cathode Recipe.x ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),
		
	),

	<<{Arrange in Rows( 4 )}
);
colpick=test << Column Switcher(
	:Cathode Recipe.x,
	{:Cathode Batch ID.x, :Anode Batch ID.x, :Electrolyte Recipe.x, :Anode Recipe.x, :Separator Recipe.x, :Separator Batch ID.x}
);
test << Local Data Filter(
	Add Filter(
		columns( colpick<< get current ),
		Display( colpick<< get current, N Items( 15 ), Find( Set Text( "" ) ) )
	)
);

The column switcher is created and works as expected.  What I would like to happen is when the column is switched that the local data filter is updated with the respective values of that column to allow the user to further refine their view of the data. I think I am close.  How should the local data filter be coded to get the column switcher column and then update?

image.png

 

Thanks in Advance

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to connect column switcher and local data filter together

Here is a rework of your code, usiing the Semiconductor Capability sample data table.

txnelson_0-1648897604733.png

txnelson_1-1648897636775.png

Names Default To Here( 1 );
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
test = Fit Group(
	Oneway(
		Y( :NPN1 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	), 
	
	Oneway(
		Y( :PNP1 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	),
	Oneway(
		Y( :NPN2 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),

	),
	Oneway(
		Y( :PNP2 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	), 

	<<{Arrange in Rows( 4 )}
);

// Set the Column Switcher
colpick = test << Column Switcher( :Site, {:lot_id, :wafer, :site, :wafer id in lot id} );

// Add a script to the Column Switcher to change the Local Data Filter
// whenever the selection in the Column Switcher is changed.  When a change
// is detected, the existing Local Data Filter is deleted and a new one
// is created, with the new column that was selected in the Column Switcher
(test << top parent)[listboxbox( 1 )] << set script(
	Try( test << remove local data filter );
	mycurrent = ((test<<top parent)[listboxbox(1)]<< get selected)[1];
	test << Local Data Filter(
		Add Filter(
			columns( column(mycurrent) ),
			Display( column(mycurrent), N Items( 15 ), Find( Set Text( "" ) ) )
		)
	);
);

// Create the initial Local Data Filter
test << Local Data Filter(
		Add Filter(
			columns( colpick << get current ),
			Display( colpick << get current, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	);

 

 

Jim

View solution in original post

3 REPLIES 3

Re: How to connect column switcher and local data filter together

txnelson
Super User

Re: How to connect column switcher and local data filter together

Here is a rework of your code, usiing the Semiconductor Capability sample data table.

txnelson_0-1648897604733.png

txnelson_1-1648897636775.png

Names Default To Here( 1 );
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
test = Fit Group(
	Oneway(
		Y( :NPN1 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	), 
	
	Oneway(
		Y( :PNP1 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	),
	Oneway(
		Y( :NPN2 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ),

	),
	Oneway(
		Y( :PNP2 ),
		X( :Site ),
		Quantiles( 1 ),
		Means( 1 ),
		Box Plots( 1 ),
		Mean Diamonds( 0 ),
		X Axis Proportional( 0 ),
		Points Jittered( 1 ),
		Grand Mean( 0 ), 
		
	), 

	<<{Arrange in Rows( 4 )}
);

// Set the Column Switcher
colpick = test << Column Switcher( :Site, {:lot_id, :wafer, :site, :wafer id in lot id} );

// Add a script to the Column Switcher to change the Local Data Filter
// whenever the selection in the Column Switcher is changed.  When a change
// is detected, the existing Local Data Filter is deleted and a new one
// is created, with the new column that was selected in the Column Switcher
(test << top parent)[listboxbox( 1 )] << set script(
	Try( test << remove local data filter );
	mycurrent = ((test<<top parent)[listboxbox(1)]<< get selected)[1];
	test << Local Data Filter(
		Add Filter(
			columns( column(mycurrent) ),
			Display( column(mycurrent), N Items( 15 ), Find( Set Text( "" ) ) )
		)
	);
);

// Create the initial Local Data Filter
test << Local Data Filter(
		Add Filter(
			columns( colpick << get current ),
			Display( colpick << get current, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	);

 

 

Jim
Hegedus1
Level III

Re: How to connect column switcher and local data filter together

Thank you that is exactly what I needed.  And I would never of figured that out on my own.