How to Use the CUBERANKEDMEMBER Function in Excel

Today, we’ll explore the CUBERANKEDMEMBER function, a powerful tool for those working with OLAP (Online Analytical Processing) data sources in Excel and Google Sheets. This function is critical for retrieving specific ranked elements or members from a data set within a cube structure.

Syntax

The CUBERANKEDMEMBER function follows this syntax:

CUBERANKEDMEMBER(connection, member_expression, set_expression, rank, )
  • connection: A text string that specifies the OLAP database connection.
  • member_expression: A text string that identifies the member within the set to be ranked.
  • set_expression: A text string that defines the set in which the ranking is applied.
  • rank: A numeric value that specifies the rank of the member to be retrieved.
  • caption (optional): A boolean value determining whether to return the member’s name or unique identifier.

Examples

Consider an example where we have a dataset of sales data in an OLAP cube and we wish to identify the top 3 products by sales amount.

Excel

In Excel, you can utilize the CUBERANKEDMEMBER function as follows:

Product Rank Product Name
1 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 1, TRUE)
2 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 2, TRUE)
3 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 3, TRUE)

Google Sheets

In Google Sheets, you would use the CUBERANKEDMEMBER function identically:

Product Rank Product Name
1 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 1, TRUE)
2 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 2, TRUE)
3 =CUBERANKEDMEMBER(“OLAPDB”, “[Measures].[Sales Amount]”, “[Product].[Product Name].Members”, 3, TRUE)

Using the CUBERANKEDMEMBER function allows you to efficiently extract ranked members from OLAP cubes, significantly enhancing your analytical capabilities.

More information: https://support.microsoft.com/en-us/office/cuberankedmember-function-07efecde-e669-4075-b4bf-6b40df2dc4b3

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 a member or tuple in a cube hierarchy Use to validate that the member or tuple exists in the cube
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
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