Outputting blank values as null or fixed values - 6.5

tMap

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
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 ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
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
EnrichPlatform
Talend Studio

You can output blank values as null or fixed values using expressions.

To output blank values of a column as null, use the following expression syntax:

rowName.columnName.equals("")?null:rowName.columnName

To output blank values of a column as fixed values, use the following expression syntax:

rowName.columnName.equals("")?fixValue:rowName.columnName

In the following example, any blank values in the name column will be replaced with null; any blank values in the company column will be replaced with the string Unknown.

The following two tables show the input and output of a tMap component with these two expressions applied.

Input table:

id name company
1 John Talend
2   Apple
3 Jane  

Output table:

id name company
1 John Talend
2 null Apple
3 Jane Unknown