8 Replies Latest reply: Jun 14, 2017 3:49 PM by Antonio Mancini RSS

    Count Customers with Similar Products

    Todd Johnston

      Hello All,

       

      I'm sure there is an easy way to do this, but I am having difficulty.  I would like to create a Flag that identifies what customers have the same products.  I am hoping to do this within the load script.  Hopefully, the following table will be clear:

       

      Company Fruit
      Company AApples
      Company AOranges
      Company BStrawberries
      Company BGrapes
      Company CApples
      Company COranges
      Company DApples
      Company DGrapes

       

      In this scenario, I would like to know what Companies have both Apples and Oranges.  It's easy to see that the answer should be A&C, however, I am struggling to create the appropriate logic.  The formula I am using is returning A,C and D as well, when D only has apples and not both fruit.  It appears that my logic is keeping each type of fruit exclusive of the pair.

       

      Hopefully, this was clear and someone can assist.

       

      Thanks in advance.

       

      TJ