cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
TamedZebra
Level II

Filtered Combo Box for Data Table

I 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".

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Filtered Combo Box for Data Table

Here 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 );
			
		)
	)
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Filtered Combo Box for Data Table

Here 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 );
			
		)
	)
);
Jim
TamedZebra
Level II

Re: Filtered Combo Box for Data Table

ありがとうございます。

欲しい機能がJSLにて記述することができました。

完璧です!!!!!

Recommended Articles