Setting null value to a constant using pentaho data integration

The  NULL is the term used to represent a missing value. A NULL value in a table is a value in a field that appears to be blank.

A field with a NULL value is a field with no value. It is very important to understand that a NULL value is different than a zero value or a field that contains spaces.

Pentaho has a built-in step that is specially built to address this issue namely “IF FIELD VALUE IS NULL”.The following steps will guide you through the steps required to overcome null issues at CSV file level.

1. Take a CSV file and using the select values step select the desired column which has the null values issue. In this case we have a column named “STATUS REASON”. So keeping that we have removed all other unnecessary fields in the remove tab.

If you preview the data you’ll find some null values which we need to replace with.

2. Now take “If field value is null” step and specify the field name and the value with which you want to replace the null value with as shown below. Here we are replacing Status Reason’s null values with Not Contacted.

3. Finally we throw the output to Dummy step which when previewed shows the following outcome replacing all the null values with Not Contacted.

Leave a Reply