Solve for isNull across multiple columns at once
- 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
I have a number of columns with null values. Is there a simple way to replace all nulls in certain columns without doing a separate formula for each column? I do not want to create any new columns.
Example:
Column A / Column B / Column C - if any of the values in column A, B, or C are null, then replace with 0 in that original column of data
Thank you in advance!
Solved! Go to Solution.
- Labels:
- Optimization
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @ewall
You could use a data cleanse tool or a multi-field formula tool. I would recommend the latter, it would look something like this:
The key thing is to uncheck the box for copy output fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @ewall,
I'd go for the data cleansing approach as it's the simplest method:
Before:
After:
I've attached my workflow for you to download if needed!
Kind regards,
Jonathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One addendum to what @Luke_C said - if the columns are numeric - datacleanse does everything for you when you check "replace with 0 (numeric fields) - but we all like the tools we like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Interesting @Luke_C, that we both went for the opposite approach!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Jonathan-Sherman @apathetichell Data cleanse is great too! Just have had some uses for the multi-field recently so there's some recency bias 😁
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Just to add a bit of background for @ewall...to decide on the approach i'd ask myself a question...
Do these columns (and will they always) contain only numeric values. If so then data cleansing works perfectly, if not then you'd need to go down the route of the multi-field formula tool as the data cleansing tool would convert null values to blanks in columns that have non-numeric data types
Kind regards,
Jonathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Jonathan-Sherman @Luke_C - thank you!! Both work, and the knowledge is much appreciated. I'll be using data cleansing for this one because they will always be numeric, but I have other flows where it looks like the multi-field formula tool will be the way to go.
Thank you both!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No problem at all, glad it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all, what should I do if I want to Backward/Forward fill all the null values in multiple columns?
