[Table of Contents] [docx version]
SpreadsheetML Reference Material - Table of Contents
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 |
The name of the connection to the cube. | ||
argument-list |
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:
CUBEVALUE("Sales","[Measures].[Profit]","[Time].[2004]",
"[All Product].[Beverages]")
CUBEVALUE($A$1,"[Measures].[Profit]",D$12,$A23)
CUBEVALUE("Sales",$B$7,D$12,$A23)
end example]