6 Replies Latest reply: Dec 24, 2009 2:28 PM by Jean-Jacques Jesua RSS

    Need help in calculation

      Hello all!

      We have two tables (see attached qvw):

       

      Dates:
      LOAD * INLINE
      [date_c, month
      2009-11-1, 11
      2009-11-1, 11
      2009-11-2, 11
      2009-12-1, 12
      2009-12-1, 12
      ];
      Orders:
      LOAD * INLINE
      [date_c, customer, ordercnt
      2009-11-1, first, 1
      2009-11-1, second, 1
      2009-11-2, first, 1
      2009-12-1, first, 1
      2009-12-1, second, 1
      ];


      And we have text object with formula: =Sum(ordercnt)/Count(Distinct customer)

      In November the result is 1,5. This is correct. (We have 3 orders and two customers).

       

      In December the result is 1. This is correct. (We have 2 orders and two customers).

       

      Without selections result is 2,5. This is correct too. (We have 5 orders and only two customers).
      But i need somthing different. I need 1,25 in result expresion. (1,5+1)/2 (Average value of this expression in two months)

      Thnx