How to Use the CUBEMEMBER Function in Excel

Today, we will explore the CUBEMEMBER function available in Excel and Google Sheets. This function plays a crucial role in fetching a specific member or a tuple from a cube in an Online Analytical Processing (OLAP) database.

Overview

The CUBEMEMBER function is structured as follows:

CUBEMEMBER(connection, member_expression) 
  • connection: A string that denotes the name of the OLAP cube from which data is to be retrieved.
  • member_expression: A string specifying the distinctive name, key, or caption that identifies the member within the cube.

Example Tasks

Below are several practical scenarios illustrating how the CUBEMEMBER function can be effectively employed:

Task 1: Retrieve a Specific Member

In this example, we aim to extract the sales amount for the member ‘Beverly Hills’ from an OLAP cube named ‘SalesData’.

Connection Member Expression Result
‘SalesData’ ‘[Store].[City].[Beverly Hills]’ =$CUBEMEMBER(“SalesData”, “[Store].[City].[Beverly Hills]”)

Task 2: Retrieve a Tuple

This example demonstrates retrieving sales data for the combination of the member ‘Beverly Hills’ and the month ‘January’ from the ‘SalesData’ OLAP cube.

Connection Member Expression Result
‘SalesData’ ‘([Store].[City].[Beverly Hills], [Time].[Month].[January])’ =$CUBEMEMBER(“SalesData”, “([Store].[City].[Beverly Hills], [Time].[Month].[January])”)

Task 3: Retrieve All Members of a Hierarchy

Here, we look to fetch all members of the ‘Product Category’ hierarchy within the ‘SalesData’ OLAP cube.

Connection Member Expression Result
‘SalesData’ ‘[Product].[Category].[All]’ =$CUBEMEMBER(“SalesData”, “[Product].[Category].[All]”)

The examples provided showcase the versatility of the CUBEMEMBER function in Excel and Google Sheets for accessing precise members or tuple combinations from OLAP cubes. It’s important to tailor the connection and member expressions to align with the specific requirements of your data model and cube architecture.

More information: https://support.microsoft.com/en-us/office/cubemember-function-0f6a15b9-2c18-4819-ae89-e1b5c8b398ad

Other functions
Returns a key performance indicator (KPI) name, property, and measure, and displays the name and property in the cell A KPI is a quantifiable measurement, such as monthly gross profit or quarterly employee turnover, used to monitor an organization's performance
Returns the value of a member property in the cube Use to validate that a member name exists within the cube and to return the specified property for this member
Returns the nth, or ranked, member in a set Use to return one or more elements in a set, such as the top sales performer or top 10 students
Defines a calculated set of members or tuples by sending a set expression to the cube on the server, which creates the set, and then returns that set to Microsoft Office Excel
Returns the number of items in a set
Returns an aggregated value from a cube