SQL Server Performance

AVG factdata to time dimension

Discussion in 'Analysis Services/Data Warehousing' started by diditho, Dec 13, 2004.

  1. diditho New Member


    hi, i'm newbie in MDX

    i can't use the AVG function in cases where you need to calculate average by dividing the total amount by a specific count varying at different levels or different members wih this statement?

    Avg([time].currentmember.children,[Measures].[Unit Sales])


    how can i calculate an amount average by Sales? The sales days vary each level [Year].[Quarte].[Month].[Days]?

    thank you
  2. Raulie New Member

    Can you explain a little more about what you want to accomplish, but to calculate the average sales or values for a given period, divide the total monthly sales or values by the number of months contained in the given period of time.

    [Measures].[Unit Sales] /
    Count(Descendants([Time].CurrentMember, [Month]))

    hope this helps

    Raulie
    Hewlett-Packard Company

Share This Page