Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Checking multiple columns for value, ignoring null

Hello,   I am trying to replace the values of a column from the values of another column (if not null).  I have 3 columns [Zip Code], [Zip Code.1], and [ZipCode] -- no row has null across for the 3...
  • mahoneypat's avatar
    3 years ago

    The first part of the if is probably the problem. If Zip Code and Zip Code.1 are both null, you will get null. You can use the Coalesce syntax to get your desired result by updating the each part with the below syntax

     

    each [Zip Code] ?? [Zip Code.1] ?? [ZipCode]

     

    It will return the first non-null value.

     

    Pat