One can restrict an existing data filter further with the command:
df << (Filter Column(:age) << Where(::age == 14));
To add a new data filter group (standard setting: filter1 OR filter2)
one can use:
df << Add Filter(Columns(:age), Where(::age == 14));
I just noticed that if the data filter is set to "conditional", it is not possible to add a new filter group.
You can still use the code, but the action is exactly like in the first case: new filter is included in the first filter.
This means that it is not possible to define 2 distinct filter groups with conditional behavior.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Graph Spacing( 5 ),
Variables,
Elements( Points( Legend( 2 ) ) ),
);
df = gb << Local Data Filter(
Add Filter( columns( :sex, :name ),Where(:sex="M"),Display( :name, N Items( 6 ))),
Add Filter( columns( :sex, :age, :name ),Where(:sex="F"), Display( :name, N Items( 6 )))
);
wait(5);
// 2 separate data filters --> OR
gb <<Remove Local Data Filter;
wait(1);
df = gb << Local Data Filter(
Conditional,
Add Filter( columns( :sex, :name ),Where(:sex="M"),Display( :name, N Items( 6 ))),
Add Filter( columns( :sex, :age, :name ),Where(:sex="F"), Display( :name, N Items( 6 )))
);
// 2nd data filter is included in the first one