Data conversion in SSIS

  • I've to find difference between 2 excel columns in SSIS, The data type is DT_WSTR, so I tried converting data type using the Data Conversion transformation editor - Changed it to DT_[2]. In Conditional Split I used this formula

    (([Copy of F21] - [Copy of F18]) > 0.17)

    It gave me this error. "The expression "([Copy of F21] - [Copy of F18]) > 0.17" on "output "Case 1" (720)" evaluated to NULL, but the "component "Conditional Split" (612)" requires a Boolean results. Modify the error row disposition on the output to treat this result as False (Ignore Failure) or to redirect this row to the error output (Redirect Row). The expression results must be Boolean for a Conditional Split. A NULL expression result is an error."

    Where is it going wrong? Any help please?

  • You likely have a NULL value in one of your two fields in your expression. Try to use the REPLACENULL() function on both of your columns to set the value to zero when the field is NULL.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Sorry for my ignorance but I did not find ReplaceNull() function. I tried this in COnidtional SPlit

    ISNULL(([Copy of F21] - [Copy of F18]) > 0.17)

    , The results are only Null values:

    F18F19F20F21

    NULLNULLNULLNULL

    NULLNULLNULLNULL

    NULLNULLNULLNULL

    NULLNULLNULLNULL

    NULLNULLNULLNULL

  • ReplaceNull() function usage based on your current example expression:

    REPLACENULL([Copy of F21], 0.00) - REPLACENULL([Copy of F18], 0.00) > 0.17

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I'm using Sql Server 2008, that's the reason i cant find this REPLACENULL() function. I see this function in SSIS 2012 but i dont think i can deploy 2012 SSIS packages in Sql Server 2008.

  • OK, then we'll need to use a conditional check for ISNULL on each column...

    (ISNULL([Copy of F21]) ? 0 : [Copy of F21]) - (ISNULL([Copy of F18]) ? 0 : [Copy of F18]) > 0.17

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Thank you so much....that worked!!!

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply