Comparing Nulls Inside a Conditional Split

  • I have a conditional split where I'm comparing two columns where it is certain that they can have null values. I'm writing the expression as follows:

    var_a == var_b

    but I'm noticing that this is never evaluating to true when the values are null. How can I get around this?

  • I never found an easy fix for this but managed to find a work around. I changed my datasource task to use a "Select" statement and added the ISNull(Fildname,'') in the select statment

  • TRY THIS:

    ISNULL([var_a] == [var_b]) ? (ISNULL([var_a]) && ISNULL([var_b])) : [var_a] == [var_b]

    LET ME KNOW IF IT WORKS

    THNX

    ------------------
    Why not ?

  • You just can't compare two values if there are possible null values. You can compare null with "unknown", so your expression will fail sometimes.

    So, either clean-up your input with isnull, as you did, or write an expression in the conditional split that checks for null values, as vineet1234 proposed.

    @vineet1234: your caps-lock is broken. You should try out another keyboard.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This was removed by the editor as SPAM

Viewing 5 posts - 1 through 4 (of 4 total)

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