4.5. Filter node

4.5.1. Description

Icon: image102

  • 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) image103.

  • Select a subset of records by setting conditions in the predicate zone image104.

image105

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

image106

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.

image107

In the configuration zone of the filter node:

  • image108 Click the label to open the window you want.

  • image109 Under Comparison, select ‘is the greatest in the column’ or ‘is the smallest in the column’.

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 image110.

image111

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 image112 :

  • Is in the column.

  • Is not in the column.

  • Contains at least one column item.

  • Contains no column items.

Note

The Ignore character case option* image113 is available for the four operators.

image114

Once one of the four operators has been selected, click the button to the right of the text box image115:

image116

Now just select the column to be searched for data for the right section of the condition:

image117

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:

image118