How to replace NULL value in Mapper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 03:12 AM
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 result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 04:34 AM
Hi Bhaskar ,
You can use ternary operator to replace null value with number.
eg:- $firstname==‘null’?0:‘’
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 08:08 AM
It worked. Had to remove the quotes before and after NULL.the condition looked like
$firstname==null?2:$firstname
Thanks much for the idea
