cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

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 II

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