cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

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

How to switch Group X to display all items or only certain items?

How to switch Group X to display all items or only certain items?
As shown in the JSL below, using Where can make Group X display only specific items. However, it is not possible to toggle between displaying all and displaying partial items. How should this be modified? Perhaps using add variable() is needed, but I cannot find how to use add where.

 

Names Default To Here( 1 );
selection = 1;
New Window( "Example",
	cb = Combo Box( {"Only age 13 and 16", "All age"}, selection = (cb << Get()) ),
	Button Box( "Plot",
		dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

		gb = dt << Graph Builder(
			Size( 528, 500 ),
			Show Control Panel( 0 ),
			Variables( X( :sex ), X( :age, Position( 1 ) ), Y( :height ), Group X( :age ) ),
			Elements( Points( X( 1 ), X( 2 ), Y, Legend( 10 ) ) ),
			If( selection == 1,
				Where( Contains( {13, 16}, :age ) ),

			),

		);
	)
);
1 REPLY 1
jthi
Super User

Re: How to switch Group X to display all items or only certain items?

You have multiple different options:

  • have two separate graph builder expressions
  • use (hidden) local data filter
  • build the graph builder expression with Where 
  • use linked subset (which is filtered using your conditions) for the graph builder

Here is one way of using Where

Names Default To Here(1);
selection = 1;
New Window("Example",
	cb = Combo Box({"Only age 13 and 16", "All age"}, selection = (cb << Get())),
	Button Box("Plot",
		dt = Open("$SAMPLE_DATA/Big Class.jmp");
		gb_expr = Expr(Graph Builder(
			Size(528, 500),
			Show Control Panel(0),
			Variables(X(:sex), X(:age, Position(1)), Y(:height), Group X(:age)),
			Elements(Points(X(1), X(2), Y, Legend(10)))
		));
		
		If(selection == 1,
			Insert Into(gb_expr, NameExpr(Where(Contains({13, 16}, :age))));
		);
		gb = Eval(EvalExpr(Send(dt, Expr(gb_expr))));
	)
);
-Jarmo

Recommended Articles