Skip to main content
Version: I2023.4.1

CUBEMEMBER

The CUBEMEMBER function returns a member or tuple from the cube. You can use it to validate that the member or tuple exists in the cube.

Before you begin

Ensure you know the syntax and specifics of CUBEMEMBER. For details, see CUBEMEMBER function.

Syntax

CUBEMEMBER(connection, member_expression, [caption])

Consider that for member_expression you cannot include in-line MDX functions. Instead, you should use a key-based MDX member reference string. member_expression can also be a tuple, specified as a cell range or an array constant. Here are a few examples:

  • Static text string: "[Measure].[Order Quantity]"
  • Concatenated text string: "[Product].[Product Categories].[Category].&["&B16&"]"
  • Cell range: B1:B3
  • Cell list: {"[Measures].[Order Quantity Long]","[Product].[Product Categories].[Category].&[4]"}
  • Cell list: (B1,B3)

The following examples show how you can use the CUBEMEMBER function.

CUBEMEMBER(connection,measure member)

MDX query name: :

B1= Internet Sales Amount Local

Example: :

C1=CUBEMEMBER("Connection Name", "[Measures].["&B1&"]")

CUBEMEMBER(connection, measure member, [caption])

MDX query name: :

B2= Order Quantity Long

Example: :

C2=CUBEMEMBER("Connection Name", "[Measures].["&B2&"]", "Order Quantity")

CUBEMEMBER(connection, dimension member)

This example is for lower level of the hierarchy.

MDX query name: :

Country = United States
State = CA
Country Code= US

Example: :

``C7=CUBEMEMBER("Connection Name", "[Customer].[Customer Geography].[Customer Country].& [CA] & [US]")``

For the level of the hierarchy with more than one key column, all the key columns should be specified in the formula; in this example, State and Country Code.

CUBEMEMBER(connection, CUBEMEMBER Measure, CUBEMEMBER Dimension(s))

MDX query name: :

C2=CUBEMEMBER- Order Quantity
C3=CUBEMEMBER- United States
C4=CUBEMEMBER- Accessories

Examples: :

C8=CUBEMEMBER("Connection Name", (C2,C3), "Order Quantity-United States")
C9=CUBEMEMBER("Connection Name", C2:C4, "Order Quantity-US-Accessories")

CUBEMEMBER(connection, CUBEMEMBER Dimension1, CUBEMEMBER Dimension2)

MDX query name: :

C3=CUBEMEMBER- United States
C4=CUBEMEMBER- Accessories

Example: :

C10=CUBEMEMBER("Connection Name",  (C3,C4),"US-Accessories")

More information

Using CUBE functions