Convert input blank value to NULL
Could you please help me to understand how to convert a blank column to NULL value? If input is blank or "N/A" I want the out put column to be NULL not Blank column. NULL is not a string here . I used below exp[ression. LEN(TRIM(column1 )) == 0 ? NULL(DT_STR,50,1252) : column1 This gives me below error. Thanks for your help.
October 17th, 2012 7:31am

HI tech consultant, TRIM(ColumnName)=="" ? (DT_WSTR, 50, 1252)NULL(DT_WSTR, 50, 1252) : ColumnName can you try the above expression. thanks ravilla
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2012 7:54am

what is the data type of your column?? try this... TRIM(column1) == "N/A" || TRIM(column1) == "" ? NULL(DT_STR,50,1252) : column1Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
October 17th, 2012 7:57am

Try this, TRIM(ColumnName)=="" ? (DT_STR, 50, 1252)NULL: ColumnName Rajkumar
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2012 8:09am

Try this, TRIM(ColumnName)=="" ? (DT_STR, 50, 1252)NULL: ColumnName Rajkumar please validate your expression Raj.. -- Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
October 17th, 2012 8:26am

@ETL vs ELTL Data type of the column is DT_STR. I am still getting same error with the expression you have provided.
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2012 8:36am

The expression should be TRIM(ColumnName) == ""? (DT_STR,4,1252)NULL(DT_STR,4,1252) : ColumnName Regards, Dinesh
October 17th, 2012 9:34am

Since you mention that you need to check for blanks and N/A, your expression should look like LEN(TRIM(Column1)) == 0 ? (NULL(DT_WSTR,50) : (UPPER(TRIM(Column1)) == "N/A" ? NULL(DT_WSTR,50) : Column1)) http://btsbee.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2012 9:46am

Hi Tech_Consultant, Assuming, Column type is String. Please use this condition. LEN(TRIM([Column Name]))==0 ? NULL(DT_WSTR, 10) : [Column Name] Thanks, Naveen TNaveen Kumar
October 17th, 2012 10:06am

@Dinesh, TRIM(ColumnName) == ""? (DT_STR,4,1252)NULL(DT_STR,4,1252) : ColumnName Above expression converts the input column to Unicode string. I want String output (DT_STR). Is there any way to do this?
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 12:42am

Hi Change the codepage TRIM(ColumnName) == ""? (DT_STR,4,1252)NULL(DT_STR,4,1252) : (DT_STR,10,1252)ColumnName
October 18th, 2012 1:01am

@KIngxxx1 I am still getting Unicode String output. I am looking for String output.
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 1:06am

take a one more derived column or data conversion transformation and change the data type of this column back to DT_STR... Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
October 18th, 2012 2:17am

take a one more derived column or data conversion transformation and change the data type of this column back to DT_STR... Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 2:17am

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

Other recent topics Other recent topics