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 ) ),
),
);
)
);