Magic ETL

Magic ETL

how to replace blanks with values from another column

Hi All,

 

I am trying to populate blank cell with a value from another column, i.e. 

 

if 'country' is blank then populate with a value from 'country_1'

 

I tried the below, but it doesn't seem to work. 

 

CASE

WHEN LENGTH(`Country`)=0
THEN `Country_1`

END

 

Please help!

 

Thanks

Max

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Comments

  • Domo Employee
    1. IFNULL (`country`, `country_1`)
  • Contributor

    The previously proposed formula will fix your issue, however if you need to use case statement (for another reason) the following should work I think

     

    CASE

    WHEN TRIM(`Country`) = ''
    THEN `Country_1`

    ELSE `Country`

    END

  • Contributor

    might want to use a case statement for blanks and nulls.

     

     

    Case when trim(`country`) = '' or `country` is null then `country` else `country` end

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In