cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Due to the recently reported Microsoft outage, users may be temporarily unable to access My JMP or experience a delay receiving their verification codes. If you have previously installed JMP on your computer, this outage should not impact your ability to access the software. My JMP services will be restored as soon as Microsoft resolves this issue.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Retrieving Selected Items from Filter in JMP Graph Using JSL

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 XIII

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 

 

Recommended Articles