cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to replace NULL value in Mapper

sbhaskar85
New Contributor

I have a file reader in my mapping. One of the column in the file contains NULL value. I am connection a mapper after the file reader. Is there any way to replace the NULL value with number? Tried using replace/replaceALL function but didnโ€™t get the intended resultNULL

2 REPLIES 2

Ajay_Chawda
Contributor

Hi Bhaskar ,
You can use ternary operator to replace null value with number.
eg:- $firstname==โ€˜nullโ€™?0:โ€˜โ€™

It worked. Had to remove the quotes before and after NULL.the condition looked like
$firstname==null?2:$firstname

Thanks much for the idea