Filtered Combo Box for Data TableI would like to create a combo box for the elements in column B of a data table named "AAA". This combo box is intended to display only the elements in column B that match the condition selected in a combo box for column C, similar to a local data filter. I also want to store the selected element from column B into a JSL variable named "input_value".
Automation and ScriptingRe: Filtered Combo Box for Data TableHere is a simple example
Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
Summarize( dt, agegps = by( :age ) );
namegps = {""};
nw = New Window( "Selection",
Lineup Box( N Col( 3 ),
Text Box( "Select Age" ),
Spacer Box( 15 ),
Text Box( "Select Name " ),
cbage = Combo Box(
agegps,
selected = Num( cbage << get selected );
sellist = Associative Array( (:name[dt << get rows where( :age == selected )]) ) << get keys;
cbname << set items( sellist );
),
Spacer Box( 15 ),
cbname = Combo Box(
namegps,
input_value = cbname << get selected;
Show( input_value );
)
)
);
Re: Filtered Combo Box for Data Table
thank you.
I was able to write the functionality I wanted in JSL.
Perfect!!!