3 Replies Latest reply on May 6, 2013 9:01 AM by Joshua Milligan

    pageviews/ visits

    Chloe Riordan

      hi- I think this is a simple question but I'm at a frustrated loss!

       

      basically i'm pulling in data from GA and want to do some basic calculations-  ie I have pulled in total 'visits' and 'pageviews', and would like to calculate pages/ visit.  My visits are 160k and my pages views are 467k- so I added a calculated field of [Pageviews]/[Visits] and expected to get 2.9-- but when I put in the next row it returns 15k.  The data set is for the year and each column is separated by month... any ideas what I'm doing wrong?!  All I could think was to aggregate the calculation but it doesn't seem to work

       

      I don't want to put up a workbook for confidentiality but I'd really appreciate any tips!

       

      Thanks

        • 1. Re: pageviews/ visits
          Joshua Milligan

          Chloe,

           

          I think the calculation you want is:

           

          SUM([Pageviews]) / SUM([Visits])

           

          This calculation will be done at an aggregate level; that is, whatever level of detail you have in your viz, such as Month -- e.g. the SUM of all pageviews for the month divided by the sum of all visits for the month.  If you just have Pageviews / Visists, then that calculation is done for every row and then will be aggregated -- e.g. the sum of all (pageviews / visits) for each row of data.  The end result of that calculation will very likely be different as you observed.

           

           

          Regards,

          Joshua

          • 2. Re: pageviews/ visits
            Chloe Riordan

            thanks for the reply--  I tried that but after I clicked ok on the calc box all the measure name pill boxes went red and my chart greys out--- so there must be another piece 

            • 3. Re: pageviews/ visits
              Joshua Milligan

              Chloe,

               

              After you change the calculation you will need to drag the field back onto the view to replace the old (red) fields.  The reason is that the old fields on the various cards/shelves were likely something like:

              AVG([Pages Per Visit]) or SUM([Pages Per Visit])

              because it was taking the calculation done per row and then aggregating the results.

               

              But the new calculated field will show up (once you drag to replace) as

              AGG([Pages Per Visit]

              because your new calculation is already an aggregation.

               

              Hopefully that works!

               

              Regards,

              Joshua