In Database replace null with 0
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have a dataset via in-DB tool which includes null values that i would like to replace with 0. I'll be making calculations on the columns using the formula in-db tool, but it currently doesn't read these null values so the output remains null.
I understand we can use the data cleanse tool, but i'll need to data stream out in order to do this and the second part of the workflow involves the calculations so i'm not sure how i'd get the data back in.
Does anyone know what is the best way to go about this?
Thanks
afk
Solved! Go to Solution.
- Labels:
- In Database
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you use Formula In-DB with SQL Server, this will work.
ISNULL([Field], 0)
If it's Oracle:
NVL([Field], 0)
If it's MySQL
IFNULL([Field], 0)
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Thableaus
I'm using SQL Server.
Will I need to input the formula for all fields affected? The multi-field formula tool is quite handy as I could convert multiple fields at the same time.
Thanks
afk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There's no Multi-Field formula In-DB.
Are there many fields? Because the function is very short, you can use a single Formula In-DB tool and just paste the field names into the function.
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yeah, quite a few fields with possibility of more fields added in future. Data cleanse tool also allowed me to retain the column name without having to change it. (i actually meant data cleanse in an earlier response as opposed to multi-field formula).
Guess writing the formula would be my only solution for the moment.
Will give it a go, thank you!
