cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

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