This function returns the number of roots in the specified
dimension .
The OLAPRootCount function is designed specifically
to allow you to count the number of root level members existing in
a given dimension of a specified database. This function returns a
number that equals the count of root level members in the dimension.
The function has the following syntax:
Syntax: OLAPRootCount
(database, dimension)
Explained below are the 2 parameters that have to
be provided when building this function.
- Database : Enter the name of the database which
has the dimension that you want to access / enter the cell reference
which has the name of this Database.
- Dimension : Enter the name of the dimension
in the above mentioned database whose root level members you want
the function to count / enter the cell reference which has the
name of such a dimension.
Remarks
- If a connection is not established with a database
the result will be a #value.
- The dimension specified must exist in the database
to which a connection is established and the dimension name should
be referenced exactly as it stands in the database.
- Both arguments are compulsory and neither argument
is optional.
Example
This function may be easier to understand with an
example.
- In order to build this function with more ease,
open the specific database and bring a slice from that database
into Excel. In this way you will have connected to PowerOLAP because
you now have the OLAPOpen formula automatically on your sheet
when you bring a slice of the cube into Excel.
- In Excel, use the menu: Insert -> Function
and select PowerOLAP from the drop down list.
- Choose the OLAPRootCount function from the
list of functions provided and click "Ok".
- When building the formula enter the cell range
for the database name and the dimension name for which the function
counts the root level members.
- In the following example B1 is the cell that
holds the database name and B4 is the cell that holds the dimension
name for which this function counts the root level members and
this counted number is the value that will be returned by the
function.
=OLAPRootCount
($B$1, $B$4) |
The above function returns a value = "
3" which is the total count of root level members belonging to
the dimension Version(B4) in the database "Acuity" (B1).