SSIS Package - Replacing null values in one column with values from another column

Hello All,

I have an SSIS package that imports data from an Excel file, replaces any value in Excel that reads "NULL" to "", then writes the data to a couple of databases.

What I have discovered today, is I have two columns of dates, an admit date and discharge date column, and what I need to do is anywhere I have a null value in the discharge date column, I have to replace it with the value in the admit date column. 

I have searched around online and tried a few things using the Replace funtion in Derived columns but no dice so far. 

Does anyone have any advice here?

Thanks for your time!

September 3rd, 2015 7:42pm

Might have found the solution, just used an ISNULL and replaced it with the admit column if it was null. I'll know for sure in the morning. =)
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 8:07pm

Hi JoshuaSeb,

This forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

As your issue is related to SSIS, I help you move this case to SQL Server Integration Services forum for dedicated support. Thank you for your understanding.

Best Regards,

September 4th, 2015 2:29am

Hi JoshuaSeb,

To achieve your requirement, just as you said, we can use ISNULL function to check whether the discharge column is null, then use ? : (Conditional) function to return values based on the ISNULL function result. The following expression is for your reference:
ISNULL(discharge) ? admit : discharge

Besides, we can also directly use REPLACENULL function to returns the value of admit column if the value of discharge column is NULL; otherwise, returns the value of discharge column. The following expression is for your reference:
REPLACENULL(discharge,admit)

Reference:
ISNULL (SSIS Expression)
? : (Conditional) (SSIS Expression)
REPLACENULL (SSIS Expression)

Thanks,
Katherine Xiong

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 2:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics