1 Reply Latest reply on Jun 27, 2012 4:21 PM by Tracy Rodgers

    Calculation on a calculation

      I have a set of IDs which appear a different number of times in a file.  Each ID is associated to a segment. 

       

      My first question is:  How can I calculate the average number of records for an ID in a given segment?

      For example, in the attached file, A appears 4 times and B appears twice.  Therefore the average records/ID for Seg1 is 3. 

       

      These records are also associated to a Group. 

       

      My second question is:  How can I calculate the average number of records for an ID for a given segment and group?

       

      I'd like to answer both questions using the same data set. See attached.

       

       

      Thanks!

        • 1. Re: Calculation on a calculation
          Tracy Rodgers

          Hi Robert,

           

          For the first question, place Segment and ID on the rows shelf. Then, create a calculated field similar to the following:

           

          total(sum([Number of Records]))/total(countd(ID))

           

          **Note: to use countd, an extract needs to be taken

           

          Then, place this calculation on the view, right click and select Compute Using-->Pane (Down).

           

          For the second question I'm not sure exactly the desired outcome, but editing how the calculation is computed may help resolve it.

           

          -Tracy