The syntax for Add Filter dictates that the new columns must be in the OR criteria.
Is there some way I can add rules in an iterative way?
dtf<<Add Filter(columns(column <,col>), <Where(clause)>)
Add one or more filter columns in a new OR group.
To figure this out:
Create a graph using Big Class
Add a local data filter with 2 variables (e.g. age and sex) using the AND button
Select criteria from both variables in the filter
Click the red triangle and select Script > Copy Script
Here's an example that shows the necessary syntax:
dt = open("$sample_data/Big Class.jmp");
// AND
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements(
Points( X, Y, Legend( 1 ), Jitter( 1 ) ),
Smoother( X, Y, Legend( 3 ) )
),
Local Data Filter(
Location( {935, 334} ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) ),
Add Filter(
columns( :age, :sex ),
Where( :age == {12, 13, 14} ),
Where( :sex == "M" )
)
);
Is this what you have in mind ?
gb = Graph Builder(
df = gb << Local Data Filter(
columns( :age ),
df << Add Filter(
columns( :sex ),
Where( :sex == "M" ),
are you missing a semi-colon (;) between the two df statements?
Hi PMroz,
Appreciate the response. But what I'm trying to achieve here is to add a filter to the current one after I've done some other crunching..
Where( :age == {12, 13, 14} )
//Where( :sex == "M" )
//do something else here...
gb << Add Filter(
Hi Chung Wei,
That would only add the criteria as an OR condition not AND...
sorry. I did not ask the question correctly.
I meant to ask if you would like to send separate messages to the data filter, instead of the way PMRoz showed.