How to: Set a Variable for an SAP NetWeaver BI MDX Query

Filtering data from an SAP NetWeaver Business Intelligence data source is accomplished through the use of variables defined on the data source as part of a Query cube definition. Variables are defined on the data source at the time the Query cube is created. Only Query cubes support variables. As with all query variables, Reporting Services automatically creates a query parameter bound to a report parameter, both with the same name as the unique name of the query variable on the Query cube.

To set the value for a variable in Design mode

  1. In the SAP NetWeaver Business Intelligence query designer in Design mode, click the Variables (Icon for the Query Parameters dialog box) button on the toolbar. The Variables dialog box opens.


    This button is enabled only for Query cubes with variables already defined on the data source, and not for InfoCubes.

  2. In the Default column, type or select a default value for each variable listed.

  3. Click OK.

To add an existing variable to the query

  1. Open the SAP NetWeaver Business Intelligence query designer in Query mode.


    To toggle between Design mode and Query mode, on the query designer toolbar, click the Design mode (Switch to Design mode).

    The Variables pane displays a list of the existing variables defined for the Query cube.

  2. From the Variables pane, drag the variable to the query text and drop it in a location that is syntactically correct for the MDX statement.

  3. Click OK.