Skip to main content
← All functions

CUBERANKEDMEMBER function

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 the top 10 students.

Syntax

CUBERANKEDMEMBER(Connection, Set_expression, Rank, [Caption])

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
ConnectionYesRequired. A text string of the name of the connection to the cube."Sales"
Set_expressionYesRequired. A text string of a set expression, such as "{[Item1].children}". Set_expression can also be the CUBESET function, or a reference to a cell that contains the CUBESET function."[Product].[All Products].Children"
RankYesRequired. An integer value specifying the top value to return. If rank is a value of 1, it returns the top value, if rank is a value of 2, it returns the second most top value, and so on. To return the top 5 values, use CUBERANKEDMEMBER five times, specifying a different rank, 1 through 5, each time.1
CaptionNoOptional. A text string displayed in the cell instead of the caption, if one is defined, from the cube."Top Product"

Query a local multidimensional report

Use CUBERANKEDMEMBER in a connected seven-function report. This fictional local cube has Region, Month and Product hierarchies. A displayed caption can differ from its unique member identifier. Refresh after fact edits; every checked answer comes from the complete current source.

Browser exercise: no external business connection. Downloads contain checked fixed values, every original fact and formula text. Native Excel CUBE recalculation requires a real OLAP connection and remains separate.

Member identifiers and source-defined measures

Revenue, Cost and Target sum matching fact rows; Profit is Revenue minus Cost; Margin divides total Profit by total Revenue. An unobserved valid intersection returns empty text, while an observed numeric zero stays zero. The Revenue target KPI compares Revenue with Target: green at target, amber from 90%, red below; Trend compares the selected or latest month with its previous metadata month; Weight is one. These definitions belong to this source.

Use one member per hierarchy in a tuple. Supported sets are explicit homogeneous nonoverlapping tuples or the All member’s Children. Set sorting supports numeric, caption and metadata order. General MDX functions and arbitrary provider connections require a different runtime.

HierarchyCaptionUnique identifier
RegionAll Region[Region].[Region].[All]
RegionNorth[Region].[Region].&[North]
RegionSouth[Region].[Region].&[South]
RegionNo observed facts[Region].[Region].&[Empty]
MonthAll Month[Month].[Month].[All]
Month2026-01[Month].[Month].&[2026-01]
Month2026-02[Month].[Month].&[2026-02]
Month2026-03[Month].[Month].&[2026-03]
ProductAll Product[Product].[Product].[All]
ProductService[Product].[Product].&[Service]
ProductParts[Product].[Product].&[Parts]
MeasuresRevenue[Measures].[Revenue]
MeasuresCost[Measures].[Cost]
MeasuresTarget[Measures].[Target]
MeasuresProfit[Measures].[Profit]
MeasuresMargin[Measures].[Margin]
MeasuresCount[Measures].[Count]
MeasuresStatus[Measures].[Status]
MeasuresTrend[Measures].[Trend]
MeasuresWeight[Measures].[Weight]

Cell / resultCurrent calculated valueIndependent targetType
J2 / First member captionBlank cellCaption; identity checked in linked queriesUnchecked
J3 / Second member captionBlank cellCaption; identity checked in linked queriesUnchecked
J4 / First member revenueBlank cell410Unchecked
J5 / Second member revenueBlank cell320Unchecked
J6 / Revenue measure captionBlank cellCaption; identity checked in linked queriesUnchecked
J7 / All observed revenueBlank cell730Unchecked
J8 / Ranked region setBlank cellCaption; identity checked in linked queriesUnchecked
J9 / Members including emptyBlank cell3Unchecked
J10 / Top ranked memberBlank cellCaption; identity checked in linked queriesUnchecked
J11 / Top region revenueBlank cell410Unchecked
J12 / Original top captionBlank cell"North"Unchecked
J13 / Top unique nameBlank cell"[Region].[Region].&[North]"Unchecked
J14 / Region / first month tupleBlank cellCaption; identity checked in linked queriesUnchecked
J15 / Tuple revenueBlank cell150Unchecked
J16 / KPI value memberBlank cellCaption; identity checked in linked queriesUnchecked
J17 / KPI actualBlank cell730Unchecked
J18 / KPI goal memberBlank cellCaption; identity checked in linked queriesUnchecked
J19 / KPI goalBlank cell800Unchecked
J20 / KPI status memberBlank cellCaption; identity checked in linked queriesUnchecked
J21 / KPI statusBlank cell0Unchecked
J22 / KPI trend memberBlank cellCaption; identity checked in linked queriesUnchecked
J23 / KPI trendBlank cell-1Unchecked
J24 / KPI weight memberBlank cellCaption; identity checked in linked queriesUnchecked
J25 / KPI weightBlank cell1Unchecked
J26 / KPI current time memberBlank cellCaption; identity checked in linked queriesUnchecked
J27 / Current month revenueBlank cell190Unchecked
J28 / Set revenueBlank cell730Unchecked
J29 / Reserved empty member / current factsBlank cellEmpty text ("")Unchecked
J30 / Original zero coordinate / current valueBlank cell0Unchecked
J31 / Inline member preserves IDBlank cell410Unchecked
J32 / Unknown member errorBlank cell#N/A (formula error)Unchecked
J33 / Unknown connection errorBlank cell#NAME? (formula error)Unchecked
J34 / Conflicting hierarchy errorBlank cell#N/A (formula error)Unchecked
J35 / Unknown property errorBlank cell#N/A (formula error)Unchecked

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.