3 Replies Latest reply: Feb 2, 2017 5:23 AM by Christian Schmitz RSS

    Replace a field value subject to a specific combinations of fields

    Christian Schmitz



      I have a task in front of me, where the table looks like: ID, Country and Place.

      So if the Country is a specific value like "GERMANY" and the Place is "Munich", I would like to create a new field with the value "GER South".


      I have tried this with Group by:


      Load #GEO_ID as ID,
      Country_Name as Country_Name_test,
      Place_Name as Place_Name_test,
      if(Country_Name= 'GERMANY' and  Place_Name_test= 'Munich', 'GER South',Country_Name) as Country_Name_new 
      Resident [Geo From]
      group by ID, Country_Name_test,Place_Name_test,;


      but there is a error occurring, "Aggregation expressions required by GROUP BY clause", so I guess my group by idea is not working out.


      Does anybody have an idea how to handle this?