2 Replies Latest reply on Mar 26, 2013 3:30 PM by Nathan Schofield

    Using aggregated result of table A on table A calculation

    Nathan Schofield

      Hello,

       

      I will give an example to best explain what I am trying to achieve. Example dataset:

       

      ID          Name          Type           Unit                    Amount

      1            Bill              Free            Downloads           21

      2            Jane           Free            Downloads           23

      3            Tim             Paid            Downloads           12

      4            Bruce          Paid            Downloads           34

      1            Bill              Grossing     USD                    321

      2            Jane           Grossing     USD                    451

      3            Tim             Grossing     USD                    132

      4            Bruce          Grossing     USD                    243

       

      Note that IDs are repeated, i.e. an ID has both a Download record and a USD record

      What I want to calculate is this:

      What is the distribution of grossing based on Free or Paid type?

      For this example I would calculate like so:

      Bill+Jane are 'Free' so summing their grossing is 321+451 = 772

      Tim+Bruce are 'Paid' so summing their grossing is 132+243 = 375

      Therefore Grossing is distributed 67% Free type (772/(772+375)) and 33% Grossing type (375/(772+375))

       

      How do I achieve this? Do I have to duplicate data source and then join together? Are there any other ways?

       

      Regards,

       

      Nathan