5 Replies Latest reply on Jan 10, 2019 11:09 AM by Jeffrey Crowe

    Addition of a measure where the dimension is a specific value

    Jeffrey Crowe

      I'm not sure exactly how to describe what I am trying to do but I think this logic question will help.

       

      I want to get the percent of fresh fruit by comparing it to all fruit forms, fresh fruit, frozen fruit, and fruit drinks, by each fruit type.

      So, if I have:

         

      Fruit TypeFormQty
      BananasFresh10
      BananasFrozen20
      BananasDrink20
      ApplesFresh100
      ApplesFrozen10
      ApplesDrink10

      Fresh Percentage = Fruit(Fresh) Qty / (Fruit(Fresh) Qty + Fruit(Frozen) Qty + Fruit(Drink) Qty

      Bananas = 10 / (10+20+20)

      Bananas = 10 / 50

      Bananas = .2 (20%)

       

       

      Apples = 100 / (100+10+10)

      Apples = 100 / 120

      Apples = .833 (83%)

       

      I want to end up with this:

        

      FruitFresh Percentage
      Bananas0.2
      Apples

      0.833

      How do i specify to add the qty fresh + qty frozen.  How do I stipulate which "Form" I want to add together?

      I'm sure I'm doing this wrong but I can't think of how to do it right.

      Thanks!