Description:
This function returns the total number of members in a specified dimension.
Syntax: MEMBERCOUNT (dimension)
Remarks
Example
The MEMBERCOUNT function can be used in any database where you want to access members in a given dimension and the value for "member-count" can either used as a reference in a formula or it can be used to as a fact data value into to populate another member. This function returns the number of members corresponding to the count of total number of members in a specified dimension.
=MEMBERCOUNT ("Time") |
-returns the number of members in the dimension named "Time" from the PowerOLAP database where the formula is written. This function returns the value 18 which is the count of the total number of members in the given dimension. |
=MEMBERCOUNT ("Version") |
-returns the number of members in the dimension named "Version" from the PowerOLAP database where the formula is written. This function returns the value 3 which is the count of the total number of members in the given dimension. |
Note: A number supplied within double quotes is taken as a string parameter.
Let us take the example of a database in PowerOLAP where we have dimensions and member names whose count is to be accessed for referencing in a formula or then the count is to be accessed to assign that value as fact data to another member.
We shall use this example in this case to populate a value into a cube that uses the count of members {of a specified dimension} as a fact value to populate its own members within its own dimension. The count of member names from one dimension becomes the fact data for another member in another dimension and the value is pulled from one through to another, with the use of the "MEMBERCOUNT" function. A numeric value signifying the count of members is the number that is returned as the result for the MEMBERCOUNT function.
The formula above writes values into the "Company" cube to the "Company Info" dimension into the member named "Dimension-Members_Count" by creating the appropriate value for this member based upon the parameter that is given as input to this function. The input parameter here is the dimension name which is "CompanyInformationDetails" dimension and the member names of this dimension are accessed and their count is ascertained through this function. The count of the members referenced through the dimension in this function is the value returned by this function.