4.5. Filter node
Note
4.5.1. Description
Number of inputs: 1.
Number of outputs: 1 or more.
- Definition
A filter node lets you select the fields and records to be sent to each of its outputs.
- Configuration
For each filter node output, you can:
Select a subset of fields and rearrange them (by dragging and dropping in the columns list) .
Select a subset of records by setting conditions in the predicate zone .
Tip
If no condition is assigned to the last output link of a filter node, that last link will retrieve all the records that failed to meet any of the previous output conditions.
- Example
-
This example shows how conditions are added to configure filtering.
This filter node will retrieve values equal to France from the Country column.
4.5.2. Configuration examples
4.5.2.1. Is the greatest or smallest in the column
You may wish to filter a dataset by the greatest or smallest value in a column.
A classic example of this is retrieval of the latest rows added to a dataset. By applying the ‘is the greatest in the column’ filter to the Date of Purchase column, only recently imported rows will be retrieved.
In the configuration zone of the filter node:
4.5.2.2. Lookup function (search in the column of a table outside the flow)
You can also use the filter node to search (lookup) a column in another dataset to check a condition:
Click the predicates operator .
You can select a predicates operator in the dialog window that will open.
There are four operators for looking up condition values in the column of another table :
Is in the column.
Is not in the column.
Contains at least one column item.
Contains no column items.
Once one of the four operators has been selected, click the button to the right of the text box :
Now just select the column to be searched for data for the right section of the condition:
The example above shows the retrieval of rows in our dataset whose status is not on the reference list (us_states.csv) clearly because of spelling mistakes: