CGETMDX

The CGETMDX formula is used to retrieve a value based on the MDX statement and the intersection of the row and column.

Syntax

CGETMDX (Datasource, Catalog, MDXStatement, RowIndex, ColumnIndex)

Arguments

Datasource

(Required)

Specify the Analysis Services server that you want to connect to.

Catalog

(Required)

Specify the catalog of cubes on the datasource that you want to perform your query on.

MDXStatement

(Required)

Specify the value of MDX Statement.

RowIndex

(Required)

Specify the value of the row index.

ColumnIndex

(Required)

Specify the value of the column index.

Usage Scenarios

To retrieve a value based on the MDX statement and the intersection of the row and column.

All the arguments are compulsory.

Examples

The easiest way to generate an example of CGETMDX is to use the ‘Send as MDX’ command from the Data -> View window. First, create a simple view from one of your cubes and then select ‘Send as MDX’ (an option within the XLS icon). In the following example a very simple view from an Adventure Works Finance cube has been setup and is being sent as MDX to Excel.

This view should now appear in Excel as demonstrated below. Note that relevant cells will have CGETMDX formulas like cell C29 in the image below.

If you ungroup all columns and rows you will see how the MDX statement is setup and the row and columns referenced. Refer below.