Description:
This function returns the returns the weight of the specified child of the specified parent. This function is designed specifically to allow you to view the weight assigned to a member under a specified parent belonging to a specified dimension given as parameters to the function. The function displays the value for the weight for a child level member under a parent level member under the specified dimension. The function takes as a parameter the name of the dimension which has the required members, the name of the parent level member and the name of the child level member whose weight is to be accessed and is the value you wish the function to return.
Syntax: WEIGHT (dimension, parent, child)
Remarks
Example
=WEIGHT ("Region", "ASIA", "Japan") |
-returns the weight of the child member "Japan" which belongs to the parent ASIA" from the dimension Region (the value returned is : "1") |
=WEIGHT ("Version", "Variance", "Actual") |
-returns the weight of the child member Actual which belongs to the parent "Variance" from the dimension Variance (the value returned is: "-1"). |
Let us take the example of a cube in PowerOLAP which requires data that is the value for the weight of a member accessed through its parent and child member and the dimension name which has the members, all of which are to be given as a parameter to the function. If in the same dimension in another member or in another dimension in another cube, you want to display this accessed WEIGHT value for the parameter supplied to the function then it is appropriate to use the WEIGHT function to access this value. In this case we can write a formula in the cube in PowerOLAP to access this value for a specific child member under a specific parent belonging to a specified dimension. With this function one can write this value of the WEIGHT to another member that is supposed to hold this value as fact data or you can also write this value to a different dimension in a different cube.
The screen above shows a formula for the WEIGHT function. The formula writes a value into the "MetaDataValues" dimension, into the "Weight" member. In the formula, the WEIGHT function takes three parameters, which are, the name of the dimension whose members are accessed, the name of he parent member which has the children you wish to access and the name of the child member, the "Weight" of which has to be returned as the result of the function. These formula accesses the weight based upon these three parameters that are given and then depending upon the hierarchy defined, the resultant value is returned by the function. The function above accesses the alias groups from the "Version" dimension, and from there it accesses the weight for the "Forecast" member that is the child of the "Variance_vs_Forecast" parent. The weight of 0"Forecast" is the value returned which is "-1".