{
  "category": "Cubes",
  "display_name": "CUBEMEMBER",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.CUBEMEMBER",
  "implementation_state": {
    "answer_bank": null,
    "detail": "No catalogue row at this commit. Pivot tables are being implemented in full, and this function with them.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": false,
    "state": "refuses",
    "state_label": "Refuses or not implemented",
    "summary": "Not yet implemented",
    "workbook_corpus": null
  },
  "implementations": [],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.CUBEMEMBER.json",
  "name": "CUBEMEMBER",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\nSeven functions form the cube family, and they divide cleanly by what they return:\n\n| Function | Returns |\n|---|---|\n| `CUBEMEMBER` | one member or tuple — a coordinate |\n| `CUBESET` | a set of members or tuples |\n| `CUBESETCOUNT` | the cardinality of a `CUBESET` result |\n| `CUBERANKEDMEMBER` | the nth member of a set — a coordinate drawn out of a set |\n| `CUBEMEMBERPROPERTY` | a property value hanging off a member |\n| `CUBEKPIMEMBER` | a KPI component, itself usable as a coordinate |\n| `CUBEVALUE` | the aggregated number at a coordinate |\n\n`CUBEMEMBER` and `CUBERANKEDMEMBER` are the two coordinate producers; `CUBEVALUE` is the only\nconsumer that yields a number.\n\nReaders confuse `CUBEMEMBER` with `GETPIVOTDATA`. They are not siblings: `GETPIVOTDATA` reads a\nPivotTable already present on a sheet, while `CUBEMEMBER` addresses the cube directly and needs\nno PivotTable at all. They do meet at one edge — a `CUBEMEMBER` expression naming a\nsession-scoped calculated member created inside a PivotTable breaks when that PivotTable goes\naway.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n- There is no kernel to port. Any implementation is an MDX parser plus a client for an\n  analysis server; the \"function\" is a thin request wrapper. This is exactly why the reference\n  engine defers it.\n- The dual display/identity value is the load-bearing design decision. An implementation that\n  returns plain caption text will look correct in isolation and then fail the moment a\n  `CUBEVALUE` cell references it — the composition breaks, not the individual cell.\n- Captions are localized by the server and its language packs. Two workbooks against the same\n  cube on differently configured servers can display different text from identical formulas.\n  A caption is therefore not a stable identifier and should never be used as a join key.\n- The 255-versus-32,767 character asymmetry between inline literals and referenced cells is a\n  documented behaviour that a generator emitting long MDX must respect.\n\n\n",
    "quirks": "\n### Result and edge cases\n\nNothing in the shared coercion chapter governs this function usefully: there is no numeric\ndomain, no array lift worth describing, and the interesting behaviour lives entirely in\nresolution against a remote server.\n\n\n\n### Errors\n\n\nAs documented by Microsoft on the page linked below:\n\n- **`#NAME?`** — the connection name is not a valid workbook connection; or the OLAP server is\n  not running, not available, or returns an error. Note that both a *naming* failure and a\n  *connectivity* failure land on the same code, which makes `#NAME?` ambiguous here in a way it\n  is not elsewhere in Excel.\n- **`#N/A`** — the `member_expression` syntax is incorrect; the member the MDX names does not\n  exist in the cube; the tuple has no valid intersection (typically two elements drawn from the\n  same hierarchy); or the expression refers to a session-scoped object — a calculated member or\n  named set belonging to a PivotTable that has since been deleted or converted to formulas.\n- **`#VALUE!`** — at least one element within a tuple is invalid; or the expression exceeds the\n  documented 255-character inline limit.\n\nThe Handbook has not observed any of these against a live Excel build. They are reported here\nas documented behaviour with the source named.\n\n\n",
    "sources": "- Microsoft, \"CUBEMEMBER function\" —\n  <https://support.microsoft.com/en-us/office/cubemember-function-0f6a15b9-2c18-4819-ae89-e1b5c8b398ad>\n  (syntax, argument definitions, the 255-character limit, the caption-of-last-member rule, and\n  every error condition listed above).\n- Microsoft, \"CUBEVALUE function\" —\n  <https://support.microsoft.com/en-us/office/cubevalue-function-8733da24-26d1-4e34-9b3a-84a8f00dcbe0>\n  (the statement that a referenced CUBE-function cell contributes its MDX expression rather\n  than its displayed value).\n\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`CUBEMEMBER` is not a computation. It is a *question asked of a server*. Everything on this\npage follows from that.\n\n\nGiven the name of a workbook connection to an OLAP cube and a multidimensional-expression\n(MDX) string, `CUBEMEMBER` resolves that expression against the cube and returns the member it\nnames — after first *validating* that the member exists. Microsoft's own framing for the whole\nfamily is \"use to validate that the member or tuple exists in the cube\", and validation is the\noperative verb: a `CUBEMEMBER` cell that resolves is a proof of existence, and one that does\nnot resolve is a diagnostic.\n\nThe subtlety that earns this page is that the resulting cell carries **two different things at\nonce**:\n\n1. a **display value** — the member's caption from the cube, or the `caption` argument if one\n   was supplied, and\n2. an **identity** — the MDX expression itself.\n\nWhich of the two a consumer sees depends on the consumer. A human, a `LEN`, or a text\nconcatenation sees the caption. Another CUBE function that takes the cell as an argument sees\nthe MDX expression. Microsoft states this explicitly for `CUBEVALUE`: when a cell reference is\nused for `member_expression` and that cell contains a CUBE function, the MDX expression of the\nreferenced cell is used, \"not the value displayed in that referenced cell\".\n\nThat is why the idiomatic cube report is built in two layers: a grid of `CUBEMEMBER` cells that\npin down coordinates, and a grid of `CUBEVALUE` cells that point at those coordinate cells to\nfetch numbers. The `CUBEMEMBER` layer is the addressing layer.\n\n`member_expression` may also denote a **tuple** — an intersection of members from distinct\nhierarchies — supplied as a cell range or an array constant. A tuple is a single point in the\ncube's coordinate space, not a set; the set-valued sibling is `CUBESET`.\n\n\n\n### Arguments\n\n\n`CUBEMEMBER(connection, member_expression, [caption])`\n\n- **`connection`** (required) — text; the name of a connection stored *in the workbook*, not a\n  connection string, not a server name, not a file path. This is the argument position most\n  often misunderstood: it is a lookup key into the workbook's connection collection, which is\n  why a mistyped or removed connection produces `#NAME?` rather than a connectivity error.\n- **`member_expression`** (required) — text holding an MDX expression that evaluates to a\n  *unique* member of the cube; or a tuple given as a cell range or array constant. Microsoft\n  documents a 255-character limit on the string passed directly in the formula, and notes that\n  a cell reference can carry up to the ordinary cell limit of 32,767 characters instead. That\n  asymmetry between an inline literal and a referenced cell is a real trap in generated\n  workbooks.\n- **`caption`** (optional) — text displayed instead of the cube's own caption. When the result\n  is a tuple, Microsoft documents that the caption used is the one belonging to the **last**\n  member of the tuple. Omitting `caption` means \"use whatever the cube says\", which makes the\n  displayed text a server- and language-pack-dependent value.\n\n\n"
  },
  "signature": {
    "display": "CUBEMEMBER(connection, member_expression, [caption])",
    "parameters": [
      {
        "description": null,
        "name": "connection",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "member_expression",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "caption",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "not_implemented",
        "reason": "No catalogue row at this commit. Pivot tables are being implemented in full, and this function with them."
      },
      "arity": {
        "max": 3,
        "min": 2
      },
      "category": "Cubes",
      "classification": {},
      "descriptions": {
        "long": null,
        "short": "A member or tuple of an OLAP cube, if it exists",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns a member or tuple from the cube. Use to validate that the member or tuple exists in the cube.",
        "microsoft_url": "https://support.microsoft.com/en-us/office/cubemember-function-0f6a15b9-2c18-4819-ae89-e1b5c8b398ad"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "bg-BG",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "cs-CZ",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "da-DK",
          "name": "KUBEMEDLEM"
        },
        {
          "locale": "de-DE",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "el-GR",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "en-AU",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "en-GB",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "en-US",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "es-ES",
          "name": "MIEMBROCUBO"
        },
        {
          "locale": "et-EE",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "fi-FI",
          "name": "KUUTIONJÄSEN"
        },
        {
          "locale": "fr-FR",
          "name": "MEMBRECUBE*"
        },
        {
          "locale": "he-IL",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "hr-HR",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "hu-HU",
          "name": "KOCKA.TAG"
        },
        {
          "locale": "id-ID",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "it-IT",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "ja-JP",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "ko-KR",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "lt-LT",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "lv-LV",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "nb-NO",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "nl-NL",
          "name": "KUBUSLID"
        },
        {
          "locale": "pl-PL",
          "name": "ELEMENT.MODUŁU"
        },
        {
          "locale": "pt-BR",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "pt-PT",
          "name": "MEMBROCUBO"
        },
        {
          "locale": "ro-RO",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "ru-RU",
          "name": "КУБЭЛЕМЕНТ"
        },
        {
          "locale": "sk-SK",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "sl-SI",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "sv-SE",
          "name": "KUBMEDLEM"
        },
        {
          "locale": "th-TH",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "tr-TR",
          "name": "KÜPÜYESİ işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "vi-VN",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "zh-CN",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "zh-HK",
          "name": "CUBEMEMBER"
        },
        {
          "locale": "zh-TW",
          "name": "CUBEMEMBER"
        }
      ],
      "signature": {
        "display": "CUBEMEMBER(connection, member_expression, [caption])",
        "parameters": [
          {
            "description": null,
            "name": "connection",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "member_expression",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "caption",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "CUBEMEMBER",
      "version_marker": null,
      "xlcall": {
        "code": "381",
        "symbol": "xlfCubemember"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/cubemember-function-0f6a15b9-2c18-4819-ae89-e1b5c8b398ad"
  },
  "try_it": {
    "formula": "=CUBEMEMBER(\"ThisWorkbookDataModel\",\"[Measures].[Sales]\")",
    "note": "This example needs an Excel cube connection. OneCalc cannot provide that connection in this preview.",
    "preview_status": "refused"
  },
  "url": "https://handbook.dnacalc.com/functions/CUBEMEMBER.html",
  "variants": [],
  "versions": []
}