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.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

How to make group X display only certain items.

When using Group X, all sections are cut out in the table. How should I modify the following JSL so that Group X only displays 13 and 16?"

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
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 ) ) )
);

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: How to make group X display only certain items.

You could add local data filter if something like this what you are looking for 

jthi_0-1742288489764.png

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))),
	Local Data Filter(
		Add Filter(
			columns(:age),
			Where(:age == {13, 16}),
			Display(:age, N Items(6))
		)
	)
);

Or if you are scripting, you can use Where

Names Default To Here(1);

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))),
	Where(Contains({13, 16}, :age))
);
-Jarmo

View solution in original post

txnelson
Super User

Re: How to make group X display only certain items.

Just switch the logic by using not "!"

Names Default To Here(1);

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))),
	Where(!Contains({13, 16}, :age))
);
Jim

View solution in original post

3 REPLIES 3
jthi
Super User

Re: How to make group X display only certain items.

You could add local data filter if something like this what you are looking for 

jthi_0-1742288489764.png

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))),
	Local Data Filter(
		Add Filter(
			columns(:age),
			Where(:age == {13, 16}),
			Display(:age, N Items(6))
		)
	)
);

Or if you are scripting, you can use Where

Names Default To Here(1);

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))),
	Where(Contains({13, 16}, :age))
);
-Jarmo
BabyDoragon
Level IV

Re: How to make group X display only certain items.

In the second method you mentioned, it is a positive list, show only 13 and 16.
However, is it possible to make it a negative list, for example, ignoring 17 in any situation.

txnelson
Super User

Re: How to make group X display only certain items.

Just switch the logic by using not "!"

Names Default To Here(1);

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))),
	Where(!Contains({13, 16}, :age))
);
Jim

Recommended Articles