3 Replies Latest reply: Apr 10, 2016 7:56 AM by Inna Shnaiderman RSS

    How to sum average?

    Inna Shnaiderman

      Hi,

      I have a chart which shows average of activities where I use the following  formula:

      =avg(ACTIVITY_AGING_HOURS*60)

       

      Then I want to create a chart which shows sum of each group (stage_sp) of activity by weeks(WeekPeriod)

      so I used:

       

      =sum(aggr(avg(ACTIVITY_AGING_HOURS*60),WeekPeriod,Stage_Sp))

       

      BUT- it did not give the correct result, it gives average of average I think.

       

      Please see print screens attached.

       

      Please advise.

       

       

       

       

        • Re: How to sum average?
          Stefan Wühl

          It's hard to tell what get's calculated behind the scenes just by looking at your screenshots. Would it be possible that you share a small sample QVW?

           

          If you question the results of your advanced aggregation calculation, I would recommend that you create a chart with dimensions WeekPeriod and Stage_Sp and expression Avg(ACTIVITY_AGING_HOURS*60)

           

          If you then sum up the lines per Stage_Sp and get different results as in your screenshot, that would be strange indeed.

           

          I can't really compare the numbers of your first and second table, because there are different dimensions used and the relation of the underlying facts to the dimensions is not clear to me.

           

          So a next step would be to add Week_Sp as dimension to your Average.png chart and compare both charts.

           

          Regards,

          Stefan

          • Re: How to sum average?
            Sunny Talwar

            Not really sure how this would behave as we don't have a sample to look at, but give this a shot:

             

            =Sum(Aggr(Avg(ACTIVITY_AGING_HOURS*60), WeekPeriod, Stage_Sp, Activity))