cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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