1 Reply Latest reply: May 26, 2012 9:13 AM by Stefan Wühl RSS

    Average from Average

      Hi to all

       

      I am new to qlikview and have one question concerning diagramm calculation. In a simplified manner we have the following table.

       

      ArticelPersonRating
      BallHolger10
      BallMauro30
      GoalHolger100

       

      I would like to calculate the average from average grouped by the article.

       

      If I use the simple avg-function "avg(rating)"  in a diagramm or table, the avg. rating for this table is: (10 + 30 + 100) / 3 = 46.7

       

      The value I look for is the average rating - first grouped by the article

       

      ( (10 + 30 ) / 2 + 100 ) / 2 = 60

       

      ball has an average rating from 20

      goal has an average rating from 100

      the total average rating is (20 + 100 ) / 2 = 60

       

      What is the expression / formula I have to enter to get 60 and not 46.7 ?

       

      Thank you very much for your help.

      Greetings

       


        • Average from Average
          Stefan Wühl

          Try

           

          =avg( aggr( avg(Rating), Articel))

           

          So group your avg(Rating) by Articel and get the average from that.

          aggr() is advanced aggregation which you need to use if you want to embed an aggregation function like average inside another aggregation function.