CUBEVALUE

Syntax:

CUBEVALUE ( connection , argument-list )

Description: Fetches from the OLAP cube on the SQL Server designated by connection, the aggregated value defined by a series of member-expression arguments in argument-list.

Arguments:

Name

Type

Description

connection

text

The name of the connection to the cube.

argument-list

text, reference

Each argument in argument-list is text containing a multidimensional expression (MDX) that evaluates to a member or tuple within the cube. Alternatively, an argument can be a set defined with the CUBESET function. Use any argument as a slicer to define the portion of the cube for which the aggregated value is returned. If no measure is specified in an argument, the default measure for that cube is used. If a cell reference is used for an argument, and that cell reference contains a CUBE function, then that argument uses the MDX expression for the item in the referenced cell, and not the value displayed in that referenced cell.

Return Type and Value: any – The aggregated value.

However, if

  • The connection name is not a valid workbook connection stored in the workbook, the return value is unspecified.

  • The OLAP server is not running, not available, or returns an error message, the return value is unspecified.

  • At least one element within the tuple is invalid, the return value is unspecified.

  • The syntax of member-expression is incorrect, the return value is unspecified.

  • The member specified by an argument doesn’t exist in the cube, the return value is unspecified.

  • The tuple is invalid because there is no intersection for the specified values, the return value is unspecified. (This can occur with multiple elements from the same hierarchy.)

  • The set contains at least one member with a different dimension than the other members, the return value is unspecified.

example: