6 Replies Latest reply: Feb 21, 2016 9:15 AM by Stephen Mason RSS

    Dimension: Union of 2 Columns

      I'd like to get the percentage of something happening based on two dimensions.

       

      For example, I a table looked like this:

       

      FruitA             FruitB            Result

      Apples           Oranges          1

      Bananas         Pears             1

      Pears             Apples            0

       

       

      My desired result would look like this

      Dimension      Measure

      Apples              50%

      Oranges           100%

      Bananas           100%

      Pears                50%

       

      ----------------------------------------------

      If it helps I've worked out the percentage of something happening based on one column:

      measure  = (sum(Result)/count(total <FruitA> Won))*100

      dimension = FruitA

       

      This returns a result of:

      Dimension      Measure

      Apples               100%

      Bananas             100%

      Pears                   0%