Analysis Services MDX Query Designer User Interface

 

Applies To: SQL Server 2016

Reporting Services provides graphical query designers for building Multidimensional Expression (MDX) queries and Data Mining Expression (DMX) queries for an Analysis Services data source. This topic describes the MDX query designer. For more information about the DMX query designer, see Analysis Services Connection Type for DMX (SSRS).

The MDX graphical query designer has two modes: design mode and query mode. Each mode provides a metadata pane from which you can drag members from the selected cubes to build an MDX query that retrieves data when the report is processed.

System_CAPS_ICON_important.jpg Important


Users access data sources when they create and run queries. You should grant minimal permissions on the data sources, such as read-only permissions.

System_CAPS_ICON_note.jpg Note


Importing an .mdx query from a file is not supported.

When you edit an MDX query for a report dataset, the graphical MDX query designer opens in Design mode.

The following figure labels the panes for Design mode.

Analysis Services MDX query designer, design view

The following table lists the panes in this mode:

PaneFunction
Select Cube button (...)Displays the currently selected cube.
Metadata paneDisplays a hierarchical list of measures, Key Performance Indicators (KPIs), and dimensions defined on the selected cube.
Calculated Members paneDisplays the currently defined calculated members available for use in the query.
Filter paneUse to choose dimensions and related hierarchies to filter data at the source and limit data returned to the report.
Data paneDisplays the column headings for the result set as you drag items from the Metadata pane and the Calculated Members pane. Automatically updates the result set if the AutoExecute button is selected. .

You can drag dimensions, measures, and KPIs from the Metadata pane, and calculated members from the Calculated Member pane, onto the Data pane. In the Filter pane, you can select dimensions and related hierarchies, and set filter expressions to limit the data available to query. If the AutoExecute (AutoExecute the query) toggle button on the toolbar is selected, the query designer runs the query every time that you drop a metadata object onto the Data pane. You can manually run the query using the Run (Run the query) button on the toolbar.

When you create an MDX query in this mode, the following additional properties are automatically included in the query:

Member Properties MEMBER_CAPTION, MEMBER_UNIQUE_NAME

Cell Properties VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

To specify your own additional properties, you must manually edit the MDX query in Query mode.

Graphical MDX Query Designer Toolbar in Design Mode

The query designer toolbar provides buttons to help you design MDX queries using the graphical interface. The following table lists the buttons and their functions.

ButtonDescription
Edit As TextNot enabled for this data source type.
ImportImport an existing query from a report definition (.rdl) file on the file system. For more information, see Report Embedded Datasets and Shared Datasets (Report Builder and SSRS).
Change to MDX query viewSwitch to Command Type MDX.
Change to DMX query language viewSwitch to Command Type DMX.
Refresh result dataRefresh metadata from the data source.
Add calculated memberDisplay the Calculated Member Builder dialog box.
Toggle for show empty cellsToggle between showing and not showing empty cells in the Data pane. (This is the equivalent to using the NON EMPTY clause in MDX).
AutoExecute the queryAutomatically run the query and show the result every time a change is made. Results are shown in the Data pane.
Show Aggregations buttonShow aggregations in the Data pane.
DeleteDelete the selected column in the Data pane from the query.
Icon for the Query Parameters dialog boxDisplay the Query Parameters dialog box. When you specify values for a query parameter, a report parameter with the same name is automatically created. The value of the query parameter is set to an expression that references the report parameter.
Prepare Query buttonPrepare the query.
Run the queryRun the query and display the results in the Data pane.
Cancel the queryCancel the query.
Switch to Design modeToggle between Design mode and Query mode.

To change the graphical query designer to Query mode, click the Design Mode button on the toolbar.

The following figure labels the panes for Query mode.

Analysis Services MDX query designer, query view

The following table lists the panes in this mode:

PaneFunction
Select Cube button (...)Displays the currently selected cube.
Metadata/Functions/Templates paneDisplays a hierarchical list of measures, KPIs, and dimensions defined on the selected cube.
Query paneDisplays the query text.
Result paneDisplays the results of running the query.

The Metadata pane displays tabs for Metadata, Functions, and Templates. From the Metadata tab, you can drag dimensions, hierarchies, KPIs, and measures onto the MDX Query pane. From the Functions tab, you can drag functions onto the MDX Query pane. From the Templates tab, you can add MDX templates to the MDX Query pane. When you execute the query, the Result pane displays the results for the MDX query.

You can extend the default MDX query generated in Design mode to include additional member properties and cell properties. When you run the query, these values do not appear in the result set. However, they are passed back to Reporting Services and you can use these values in a report. For more information, see Extended Field Properties for an Analysis Services Database (SSRS).

Graphical Query Designer Toolbar in Query Mode

The query designer toolbar provides buttons to help you design MDX queries using the graphical interface.

The toolbar buttons are identical between Design mode and Query mode, but the following buttons are not enabled for Query mode:

  • Edit As Text

  • Add Calculated Member (Add calculated member)

  • Show Empty Cells (Toggle for show empty cells)

  • AutoExecute (AutoExecute the query)

  • Show Aggregations (Show Aggregations button)

Define Parameters in the MDX Query Designer for Analysis Services (Report Builder and SSRS)
Create a Shared Dataset or Embedded Dataset (Report Builder and SSRS)
Analysis Services Connection Type for DMX (SSRS)
RSReportDesigner Configuration File
Analysis Services Connection Type for MDX (SSRS)

Community Additions

ADD
Show: