6 Replies Latest reply: Dec 1, 2015 10:32 AM by Sangram Reddy RSS

    Conditional renaming of certain values on import

      Hi folks,


      I've got 'Customer' data I'm importing from SQL database, and one of the fields is 'County' which is basically just a sub-national classification. Because of inconsistent importing of the data, we have multiple values which mean the same thing, for example, 'Virginia' and 'VA'.


      I can change one of these mismatches by using the following code in my LOAD statement:


      if(County = 'Virginia', 'VA', County) as County;


      but I'm stumbling on how to get more than one mismatched value, such as


      if(County = 'Utah', 'UT', County) as County,

      if(County = 'Virginia', 'VA', County) as County;


      I know I'm going about this the wrong way, and I was hoping someone out there might know how I could do this for multiple cases. Thanks!