CUBEMEMBER()

Syntax. CUBEMEMBER(connection,member_expression,caption)

Definition. This function returns a member (cell) from a cube. Use CUBEMEMBER() to validate that the member exists and to pass the member to other functions through a cell reference.

Arguments

Background. When you use CUBEMEMBER() as an argument for another cube function, the MDX expression instead of the displayed value is used in the argument.

Note

In the cell containing the function, the message #GETTING_DATA temporarily appears while the data is being queried.

Error values and messages provide information about incorrect or missing entries:

Example. So that you can gain a better understanding of the use of the functions in this section, take a close look at the PivotTable in Figure 14-5.

The candy sales PivotTable used to demonstrate the cube functions.

Figure 14-5. The candy sales PivotTable used to demonstrate the cube functions.

The formula

=CUBEMEMBER("offLine","[Products].[Product].[All].[Cookies]")

looks for a single cell and returns the Cookies member which has the caption we looked for. If you use the tuple

=CUBEMEMBER("offLine",
   "([Stores].[Store].[All].[NorthEast],[Products].[All].[Cookies],
   [Years].[2009])")

the result is 2009 (the cookie sales in the year 2009 in the NorthEast store). If you use

=CUBEMEMBER("offLine",
   "([Stores].[Group].[All].[North],[Stores].[Store].[All].[NorthEast]")

to find an empty intercept, you get the #N/A error. To display the word total, enter

=CUBEMEMBER("offLine","[Products].[Product].[All]","total")

You can use the cell containing the formula to create cell captions. The actual content of the cell is more informative if it refers to the cells with the CUBEMEMBER() entries.

See Also

All other cube functions, GETPIVOTDATA()