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

Talend Components Reference Guide

Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
Talend Studio
Data Governance
Data Quality and Preparation
Design and Development

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.