If/else statement - 7.3

tMap

Version
7.3
Language
English
Product
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 Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Processing components (Integration) > tMap
Data Quality and Preparation > Third-party systems > Processing components (Integration) > tMap
Design and Development > Third-party systems > Processing components (Integration) > tMap
Last publication date
2024-02-21

In the Expression Builder, the if / else statement can be written as follows:

condition?value if true:value if false

You can perform a null test before calling a Java method; otherwise it will throw a null pointer exception if the input data contains a null value. For example:

row1.Postal_code==null?null:row1.Postal_code.toUpperCase()

You can also write a nested statement. For example, use the following expression to retrieve the new salary for each employee based on his/her original salary.

row1.salary>=10000?row1.salary*1.05:(row1.salary>=8000?row1.salary*1.1:(row1.salary>=7000?row1.salary*1.08:row1.salary*1.2))