IF NULL leave blank

I have a CSV File that has some columns who's values are blank, I want to leave blank not null. how do I do this.
If this was SQL I'd use a case statement:
CASE WHEN condreaid IS NULL THEN ''
ELSE condreaid END AS 'condreaid'
OR
ISNULL(condreaid,'') AS 'condreaid'
The default tool is leaving them NULL

what is the EasyMorph method of doing this within the CSV task. the source file is a COMMA DELIMITED CSV file.

Hi Ronald and welcome to the Community!

You can use the "Modify column" action with the following expression:

if( isempty([condreaid]), '', [condreaid])

or even simpler

ifempty([condreaid], '')

If all values in [condreaid] are supposed to be text, then you can use the "Convert data types" action in the "Everything to text" mode - it will replace nulls (empty values) with empty strings. The action can be a convenient way to replace nulls with empty strings in multiple columns at once.

thank you very much. This worked.
I spoke today with Matthew and he hopes to get back to me about some final items we need.

Sincerely,

Hi Dmitry

I have a few columns where I want to replace null to 0.
Do I need to modify each column as I cannot see how replace table wide can work?

i.e. ifempty([Apr],0) and then ifempty([May],0) ...

Or is the answer to unpivot and replace and pivot again?

Thanks

Hi Rykie,

check out this topic: Replace in multiple columns

Thanks, Dmitry.

Hi, Dmitry and crew -

I am using the Modify column action to change the date format using an expression format([COLUMN_NAME], "MM/dd/yyyy"), however, I have fields that are empty and result with an error in the field. I have tried ifempty and isempty and I cannot get the expression right,. Can you help? Many thanks!

Hi Keeley and welcome to the Community!

You can suppress the errors like this:

 iferror(format([Column], "MM/dd/yyyy"), empty())

Alternatively, use the IF operator:

IF not isempty([COLUMN_NAME]) THEN format([COLUMN_NAME], "MM/dd/yyyy")

Thank you so much - it worked!!!!

You're welcome :slight_smile: