Skip to main content
Version: I2023.4.1

CUBEVALUE

The function combines the CUBEMEMBER functions it references, and returns an aggregated value.

Before you begin

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

Syntax

CUBEVALUE(connection, [member_expression1], [member_expression2], ...)

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 CUBEVALUE function.

CUBEVALUE(connection, CUBEMEMBER Measure)

MDX query name: :

C1= CUBEMEMBER- Internet Sales Amount Local
C2= CUBEMEMBER- Order Quantity

Example: :

C11=CUBEVALUE("Connection Name",C1)
C12=CUBEVALUE("Connection Name",C2)

CUBEVALUE(connection, CUBEMEMBER Measure, CUBEMEMBER-Dimension)

MDX query name: :

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

Example: :

C13=CUBEVALUE("Connection Name",C2,C3)

CUBEVALUE(connection, CUBEMEMBER Measure, CUBEMEMBER Dimension)

This example is for lower level of the hierarchy.

MDX query name: :

C2= CUBEMEMBER- Order Quantity
C7= CUBEMEMBER- California

Example: :

C14=CUBEVALUE("Connection Name",C2,C7)

CUBEVALUE(connection, CUBEMEMBER Measure, CUBEMEMBER Dimension, ...)

MDX query name: :

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

Example: :

C15=CUBEVALUE("Connection Name",C2,C3,C4)
C16=CUBEVALUE("Connection Name",C2:C4)

CUBEVALUE(connection, CUBEMEMBER from CUBEMEMBER formula)

MDX query name: :

C8=CUBEMEMBER- Order Quantity-United States
C9=CUBEMEMBER- Order Quantity-US-Accessories

Example: :

C17=CUBEVALUE("Connection Name",C8)
C18=CUBEVALUE("Connection Name",C9)

CUBEVALUE(connection, CUBEMEMBER from CUBEMEMBER formula, CUBEMEMBER Dimension)

MDX query name: :

C8=CUBEMEMBER- Order Quantity-United States
C4= CUBEMEMBER- Accessories

MDX query name: :

C19=CUBEVALUE("Connection Name",C8,C4)

Note that the second cubemember should be a dimension different from the cube members from the combined CUBEMEMBER. In case when the invalid CUBEMEMBER is selected, CUBEVALUE will return: #Value! Error value

IFERROR(NUMBERVALUE(CUBEVALUE("Connection Name", CUBEMEMBERMeasure, CUBEMEMBER Dimensions)

MDX query name: :

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

Example: :

C21=IFERROR(NUMBERVALUE(CUBEVALUE("Connection Name",C2,C3,C4)),0)

CUBEVALUE(connection, CUBEMEMBER Measure, CUBESET)

MDX query name: :

C2= CUBEMEMBER- Order Quantity
Cubeset(My Countries)

Example: :

C22=CUBEVALUE("Connection Name", C2,Cubeset(My Countries))

CUBEVALUE(connection, CUBEMEMBER Measure, Slicer)

MDX query name: :

C1= CUBEMEMBER- Internet Sales
C4= CUBEMEMBER- Accessories
Slicer_Color

Example: :

C20=CUBEVALUE("Connection Name",C1,C4,Slicer_Color)

IFERROR(NUMBERVALUE(CUBEVALUE("Connection Name", CUBEMEMBER Measure, CUBEMEMBER Dimensions, CUBESET)

MDX query name: :

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

Example: :

C23=IFERROR(NUMBERVALUE(CUBEVALUE("Connection Name",C2,C3,C4,CUBESET- Dates)),0)

More information

Using CUBE functions