Forum Discussion

GMCMORROW's avatar
GMCMORROW
New Member
4 years ago
Solved

Take value from another column if blank

I have 2 SQL tables, customer and address table, that i need to use logic on.    I want to take a value from the address table but if its blank i need to take a value from the Customer table.    ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi GMCMORROW ,

     

    I have built a data sample,

     

     

    You could simply use LOOKUPVALUE():

     

    Column = LOOKUPVALUE(BPADDRESS[EXTNUM_0],'BPADDRESS'[BPCNUM_0],[BPCNUM_0],[BPCNUM_0])

     

     

     

     

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.