cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

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 III

Re: Filtered Combo Box for Data Table

ありがとうございます。

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

完璧です!!!!!

Recommended Articles