filter
Establish a named filter for an inline or dedicated data set.
Name | Description | Type | Modifier |
---|---|---|---|
name | Name to assign to the filter. | String | None |
criterion | Boolean expression establishing the filter criteria. | String | None |
None
This action may be used within the following project items: test modules, data set modules, user-defined actions
name
create data set Car Rental1
 
  duration country pickup state pickup city pickup
row 3 Canada British Columbia Kamloops
row 1 United States Texas Houston
row 2 United States Florida Brossard
row 5 United States California San Diego
row 4 Canada Manitoba Dauphin
 
name criterion
filter canada_country country pickup="Canada"
 
end create data set
data set path comments
check in data set Car Rental1
 
name filter
use data set /Car Rental1 canada_country
 
text
report #state pickup
report #city pickup
 
repeat for data set
- This action may be employed within either a dedicated data set or an inline data set (within the confines of a create data set/end create data set construct, in a test module or user-defined action).
- The filter action associates a set of filter criteria with a name. It does not, in and of itself, have the effect of filtering data. The actual filtering of data occurs when the established filter is invoked, either by a use data set, use filter, or set data set value action.
- When the filter is applied, those rows of the data set whose values do not produce a True when applied to the expression in criterion are filtered out. For example, if criterion is set to
region = 2 and period >= 2002
, the filter excludes those rows in which region is not 2, as well as those rows for which period is earlier than 2002. - The following operators may be used within an expression in the criterion argument:
Table 1. Comparison operators
Table 2. Logical operatorsPrecedence Comparison operator Meaning 4 = equal to 4 <> not equal to 4 > greater than 4 >= greater than or equal to 4 < less than 4 <= less than or equal to Precedence Logical operator Meaning 5 not Value is TRUE if its operand is FALSE. 6 and Value is TRUE if and only if both sides of the and operator are TRUE. 7 or Value is TRUE if either side of the or operator is TRUE. Notes:For the full list of operator precedence, see here. - This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.