- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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