Scenario 2: Filtering a list of names through different logical operations - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Based on the previous scenario, this scenario further filters the input data so that only those records of people from New York and Chicago are accepted. Without changing the filter settings defined in the previous scenario, advanced conditions are added in this scenario to enable both logical AND and logical OR operations in the same tFilterRow component.

  1. Double-click the tFilterRow component to show its Basic settings view.

  2. Select the Use advanced mode check box, and type in the following expression in the text field:

    input_row.City.equals("Chicago") || input_row.City.equals("New York")

    This defines two conditions on the City column of the input data to filter records that contain the cities of Chicago and New York, and uses a logical OR to combine the two conditions so that records satisfying either condition will be accepted.

  3. Press Ctrl+S to save the Job and press F6 to execute it.

    As shown above, the result list of the previous scenario has been further filtered, and only the records containing the cities of New York and Chicago are accepted.