6 Replies Latest reply: Jul 6, 2011 8:52 AM by Shumail Hussain RSS

    Average Sales

    Shumail Hussain

      I am trying to get the average sales on the basis of following date:

       

      Date1Sales
      Dec-09800
      Dec-10600
      Jan-111000
      Feb-111200
      Mar-11840
      Apr-111200
      May-111500
      Jun-111800


      I need to have three expressions for averages as follows.

       

      1. Average MTD: (Current Month Sales + Previous Month Sales) / 2

       

      thing is my table is not simple to get the sales for current month i am already using set analysis as below

       

       

      sum({$<AIF = {P}, LoadDate_Active = {"=$(=Date($(#=ReportDate),'MM/DD/YYYY'))"}, Bucket_MOM = {0,1,2,3,4,5,6}>} bal)/(1000000*100)

      and in order to get the Average MTD I tried this but not working

       

      (sum({$1<AIF = {P}, LoadDate_Active = {"=$(=Date($(#=ReportDate),'MM/DD/YYYY'))"}, Bucket_MOM = {0,1,2,3,4,5,6}>} bal)/(1000000*100) +

      sum({$<AIF = {P}, LoadDate_Active = {"=$(=Date($(#=ReportDate),'MM/DD/YYYY'))"}, Bucket_MOM = {0,1,2,3,4,5,6}>} bal)/(1000000*100) )/2

       

      OR

      (

      sum({$1}{$<AIF = {P}, LoadDate_Active = {"=$(=Date($(#=ReportDate),'MM/DD/YYYY'))"}, Bucket_MOM = {0,1,2,3,4,5,6}>} bal)/(1000000*100) +

      sum({$<AIF = {P}, LoadDate_Active = {"=$(=Date($(#=ReportDate),'MM/DD/YYYY'))"}, Bucket_MOM = {0,1,2,3,4,5,6}>} bal)/(1000000*100)

      )/2

       

      2. Average YTD: (Current Month Sales + Begining of Year Sales) / 2

       

      No Idea how to do it [:S]

       

      3. Average One Year: (Current Month Sales + (12 Months Backward Sales)) / 2

       

      Also No Idea on this [:S]

       

      please anyone help me.... Thanks in Advance

       

      Shumail