cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

Data Filter: How to select multiple values + set fields

Hello

 

I'm generating a data filter on a table and I have two questions:

 

  • How can I use scripting to select several values (with contains?) for one of my data filter columns?

 

  • Is it possible to fix one of the fields? For example, having my Region field set to ‘S’ in the data filter, so that it's visible but not modifiable by the user, and the rest of the fields on the data filter (conditional on the set field) remain modifiable? I could use a subset of the table on which I'm doing my data filter, but I'd like to avoid that.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = dt <<
Data Filter(
	Conditional,
	Add( Filter Columns( :Region, :Lead ) )
);
Wait( 1 );
obj << (Filter Column( :Region ) <<
Where( Contains({"C","S"},:Region)));
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Data Filter: How to select multiple values + set fields

Scripting Index has multiple examples on how you can compare multiple values with a list

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(
	Add(Filter Columns(:Region), Where(:Region = {"N", "S"}))
);
Wait(1);
obj << (Filter Column(:Region) << Clear Selection);

You can "disable" the filter for example by disabling the tab page box but this can easily mess up the filter as user could for example use Clear

Window("Data Filter for Cities")["Data Filter",TabPageBox(1)] << Enabled(0);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Data Filter: How to select multiple values + set fields

Scripting Index has multiple examples on how you can compare multiple values with a list

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(
	Add(Filter Columns(:Region), Where(:Region = {"N", "S"}))
);
Wait(1);
obj << (Filter Column(:Region) << Clear Selection);

You can "disable" the filter for example by disabling the tab page box but this can easily mess up the filter as user could for example use Clear

Window("Data Filter for Cities")["Data Filter",TabPageBox(1)] << Enabled(0);
-Jarmo

Re: Data Filter: How to select multiple values + set fields

Thanks, as usual that's the answer I wanted! As for the clear button, I'm going to hide it and make another button that clears only unlocked filters.

Recommended Articles