Here is a rework of your code, usiing the Semiconductor Capability sample data table.
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