THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Microsoft OLAP by Mosha Pasumansky

Weigthed Aggregation in Analysis Services

In the scenarios of corporate reporting it is typical to have organizational structure where child organization reports up to its parent only percentage of its value, because they are only partially owned by the parent. In Analysis Services 2000 this would be best implemented by defining the following cell calculation

Aggregate(Ogranization.CurrentMember.Children, Val(Ogranization.CurrentMember.Properties(”Weight”))*Measures.CurrentMember)

Where Weight is defined as member property of the Organization which holds the value of percentage of ownership to the parent. In Analysis Services 2005 this can be done natively. What we have done is to extend the notion of unary operators. Previously, unary operator could have been only one of the following: +, -, *, / and ~. In Analysis Services 2005, it is possible to put inside unary operator any numeric value, which will interpreted as weight  to multiple by before aggregating up. Typically this will be a number between 0 and 1, but it doesn't have to. Now, the unary operator “+” is just a private case of weight “1”, unary operator “-” private case of weight “-1”, and unary operator “~” is private case of weight “0”. Sample database Adventure Works has example of weights as unary operators on the Organization dimension. Take a look how nice they look in UI, you don't really even need to browse unary operators binding, because UI is smart enough to automatically show the weights right next to the icon.

Published Sunday, March 27, 2005 10:53 AM by mosha
Anonymous comments are disabled
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement