5 Replies Latest reply: May 26, 2015 3:02 PM by Srikanth P RSS

    Long nested if or other solution?



      I have a data set of about 1M records  (40 months about 30K distinct IDs) that I need to group into 6 different groupings.

      The data for the groupings is fixed but the source of course changes.

      My reslut will be a table (Grouping) with unique IDs and all the 6 Groups that I use to easy make selections from the actual data.


      I have done a rather long nested if like:



      Load distinct UniqueID


      If Type is A,

           if country is B

                if Brand is D, if Brand is C, if Brand is E, FixedValue) etc

      ) as Grouplevel1


      Resident ItemDatabas


      This works but the nested if's can be rather complex upto 150 rows and thus rather un maintenance friendly.


      Could I store my fixed conditions in a table and join that in someway or other ideas?