cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

Retrieving Selected Items from Filter in JMP Graph Using JSL

BabyDoragon
Level II

In JMP, the values entered in the Text edit box can be retrieved using get text(); for items in the List box, they can be retrieved using get items().
Is there a way to get the currently selected items in the Filter of the current Graph? In the JSL below, I hope that when the Saving button above is pressed, I can obtain the items selected by the user in the Filter. How can I achieve this?
For example, how should I record that the user has selected "14 years old" in the Age Filter?

New Window( "Chamber condition checker", 
SavingButton=Button Box( "Save filter setting",),
	Graph Builder(
		Size( 528, 456 ),
		Show Control Panel( 0 ),
		Variables( X( :weight ), Y( :height ) ),
		Elements( Points( X, Y, Legend( 36 ) ), Smoother( X, Y, Legend( 37 ) ) ),
		Local Data Filter( Add Filter( columns( :age ), Where( :age == 12 ), Display( :age, N Items( 6 ) ) ) )
	)
);
2 REPLIES 2
jthi
Super User


Re: Retrieving Selected Items from Filter in JMP Graph Using JSL

You can use << Get Where clause on the filter object

jthi_0-1737712454179.png

Names Default To Here(1);

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt << Graph Builder(
	Size(528, 456),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height)),
	Elements(Points(X, Y, Legend(36)), Smoother(X, Y, Legend(37))),
	Local Data Filter(Add Filter(columns(:age), Where(:age == 12), Display(:age, N Items(6))))
);

((gb << Top Parent)["Local Data Filter"]  << Get Scriptable Object) << Get where clause;
-Jarmo
hogi
Level XII


Re: Retrieving Selected Items from Filter in JMP Graph Using JSL

To get the selected rows, talk to the LDF and ask : Get Filtered rows()

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt << Graph Builder(
	Size(400, 400),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height)),
	Elements(Points(X, Y)),
	Local Data Filter( Add Filter(columns(:age), Where(:age == 14)))
);

(current report()["Local Data Filter"]  << Get Scriptable Object) << Get Filtered  rows;


Often I want to create a subset with the selected rows.
To generate such a subset, you can click on hogi_0-1737906810618.png 
in the GraphBuilder (aka Report) Toolbar which can be downloaded from the Markeplace: https://marketplace.jmp.com/appdetails/Graph+Builder+Toolbar