MDX()
Use MDX() when the rows or columns in a report should be selected dynamically. You can also run a full MDX query or reuse an existing IBM Planning Analytics cube view.
Syntax
=MDX(cubeName, rowElements, columnElements, contextFilters, options)
=MDX(mdxQuery, options)
=MDX(cubeNameAndView, options)cubeName— The cube to read, such as"Revenue". UseConnectionName::CubeNameto select another connection.rowElements— A dimension expression, or a horizontal range containing row expressions.columnElements— A dimension expression for dynamic columns, or a range of cells for fixed columns.contextFilters— A cell or range containing the elements that apply to the whole report.options— Output flags. Combine them in one string, such as"FS".mdxQuery— A complete MDX query, supplied as text or a cell reference.cubeNameAndView— The cube and view names incubeName^viewNameformat.
Options
| Flag | What it does |
|---|---|
F | Return values with the formatting defined in IBM Planning Analytics. |
S | Write results as static values. |
G | Show repeated row labels once for each group. |
I | Indent element names by hierarchy level. Use I for one space per level, II for two, or III for three. |
R | Include empty rows when TeamOne builds the query from row and column expressions. |
C | Include empty columns when TeamOne builds the query from row and column expressions. |
H | Hide column headers. |
Z | Show zeroes in place of blanks. |
X | Skip the formula when TeamOne recalculates the sheet. Put X in the fifth argument, including when the first argument is a query or view. |
Dynamic rows and columns
Give each axis a dimension and a set expression. Combine dimensions on the same axis with * (space, asterisk, space).
dimName^setExpression
dimName^hierName^setExpression
dimName^setExpression~aliasName
dimName^setExpression~alias=aliasName~expandAboveUse the hierarchy form to select an alternate hierarchy. Specify an alias to show it in the results. By default, the formula uses principal element names. The expandAbove option displays children above their consolidations. See aliases and subset options.
For example, this axis combines regions and versions.
Region^$ROOTS>>children~Description * Version^Actual;BudgetPut the row and column expressions in cells if you want to edit the layout without changing the formula. In the example below, B2 holds the cube name, C4 and C5 hold the expressions, and C3:F3 holds the filters.
=MDX(B2, C4, C5, C3:F3, "FS")
See the dynamic rows and columns example.
Dynamic rows and static columns
Use a set expression for the rows and select a range in the sheet for the column headers. TeamOne identifies the column dimensions from the values in that range, as it does for TEAMONE(). The column labels you enter serve as the headers.

See the fixed columns example.
Run a full MDX query
Paste the complete query from Planning Analytics Workspace into a cell, then pass that cell to MDX(). For example, if the query is in B25, enter:
=MDX(B25)
Load a cube view
Pass the cube and view names together as cubeName^viewName. For example, this loads the Revenue by channel view from the Revenue cube.
=MDX("Revenue^Revenue by channel")
See the full query and cube view examples.
