Data Filter: How to select multiple values + set fieldsHello
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)));Automation and ScriptingRe: Data Filter: How to select multiple values + set fieldsScripting 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);Re: Data Filter: How to select multiple values + set fieldsThanks, 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.