CUBEVALUE()

SyntaxCUBEVALUE(connection,member_expression1,member_expression2,...)

Definition. This function returns the value of a member (cell) from a cube.

Arguments

Background. When you use CUBEVALUE() 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 wrong or missing entries:

The formula

=CUBEVALUE("offLine","[Measures].[GrossSales]","[Stores].[Store].[All].
   [NorthEast]"," [Years].[Year].[All].[2009]","[Products].[Product].
   [All].[Cookies]")

calculates the gross sales for cookies in the store NorthEast in the year 2009: $1,856.40. You get the same result if you use a tuple (the arguments of the previous formula are enclosed in parentheses):

=CUBEVALUE("offline","([Measures].[GrossSales],[Stores].[Store].[All].[NorthEast],
   [Years].[Year].[All].[2009],[Products].[Product].[All].[Cookies])")

If you enter the formula

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

in cell B3, the formula

=CUBEVALUE("offline",B3)

returns the total sales for cookies: $21,796.

You can also use the examples for the CUBEKPIMEMBER() function. The formula

=CUBEVALUE("offline",CUBERANKEDMEMBER("offline",CUBESET("offline","[Stores]
   .[Store].Children","all store sales",2;"[Measures].[sale]"),1))

returns $10,814 for the total sales of the best store (NorthEast).

See Also

All other cube functions, GETPIVOTDATA()