cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

How to get the selected items in the local data filter

(JMP 17) During the analysis process, we sometimes need to perform corresponding automated analysis based on the content I have filtered in the local filter of the Graph Builder. However, I don’t know how to get the selected content in this filter. Is there any good method? Thank you.

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: How to get the selected items in the local data filter

Usually, I use << Get Where Clause or << Get Filtered Rows as the selections done can be quite complicated.

Names Default To Here(1); 

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

gb = dt << Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Smoother(X, Y, Legend(10)))
);

ldf = gb << Local Data Filter(
	Add Filter(columns(:age), Where(:age == 12), Display(:age, N Items(6)))
);

Show(ldf << Get Where Clause);
Show(ldf << Get Filtered Rows);

 

You can also access the display box and use that, for example in my example it is List Box (List Display) but usually I would avoid this option

nw = (gb << top parent);
nw[OutlineBox("Local Data Filter"), ListBoxBox(1)] << get selected;
-Jarmo

View solution in original post

jthi
Super User

Re: How to get the selected items in the local data filter

Take a look at Data Filter from Scripting Index to get a good general idea what options you have

jthi_0-1766039244518.png

In this case you would most likely go with << Make Filter Change Handler. 

You might also consider using (Global) Data Filter instead of Local Data Filter, it will make the row state changes directly to the data table.

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: How to get the selected items in the local data filter

Usually, I use << Get Where Clause or << Get Filtered Rows as the selections done can be quite complicated.

Names Default To Here(1); 

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

gb = dt << Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Smoother(X, Y, Legend(10)))
);

ldf = gb << Local Data Filter(
	Add Filter(columns(:age), Where(:age == 12), Display(:age, N Items(6)))
);

Show(ldf << Get Where Clause);
Show(ldf << Get Filtered Rows);

 

You can also access the display box and use that, for example in my example it is List Box (List Display) but usually I would avoid this option

nw = (gb << top parent);
nw[OutlineBox("Local Data Filter"), ListBoxBox(1)] << get selected;
-Jarmo

Re: How to get the selected items in the local data filter

Thank you very much. This is exactly what I wanted!!

I have a new question: How can I use JSL to detect changes in the selection within a local data filter?

(Because I created a custom interface where the top part is the Graph Builder and the bottom part is a data table, and I want the form below to update synchronously when the filter selection changes. So, I need to know how to determine when the filter selection has been altered.)

Thank you.

jthi
Super User

Re: How to get the selected items in the local data filter

Take a look at Data Filter from Scripting Index to get a good general idea what options you have

jthi_0-1766039244518.png

In this case you would most likely go with << Make Filter Change Handler. 

You might also consider using (Global) Data Filter instead of Local Data Filter, it will make the row state changes directly to the data table.

-Jarmo

Re: How to get the selected items in the local data filter

Depending on what you mean by "corresponding automated analysis", another approach could be:

Local Data Filter -> Red Triangle -> Show Subset

This opens a Linked Subset of your data. You could run your analysis from there. Or, if you Select All (Ctrl+A) from there, that also selects those rows in your parent Data Table. 

By the way, you can also "Save Where Clause" from the same Dropdown. This is helpful if you might want to re-use this same filter later. 

Recommended Articles