Start of Content Area

Syntax documentation BW-Specific Enhancement: MDX Syntax  Locate the document in its SAP Library structure

The BW-specific line sap_variables is used as an enhancement to MDX syntax to specify variable values for all obligatory variables in an MDX statement. This line contains a list of name value pairs of SAP variables.

The following production rules are the enhancements that were defined to support a variable value specification in a MDX SELECT statement. Variable support comprises a new clause containing the SAP variables and their values.

<select_statement> :   [WITH <formula_specification>]
                       SELECT [<axis_specification>
                              [, <axis_specification>…]]
                       FROM <cube_specification>
                       [WHERE <slicer_specification>]
                       [<cell_props>]
                       [SAP VARIABLES <sap_variable> [[,] <sap_variable>…]]

<sap_variable> :       <variable_name> <sign> [<option>] <variable_value>

<sign> :               INCLUDING | EXCLUDING

<option> :             = | > | >= | < | <= | <>

<variable_value> :       <unique_member_name>
                       | <unsigned_numeric_literal>
                       | <dimension>
                       | <string_value_expression>
                       | <member> : <member>
                       | <character_string_literal> : <character_string_literal>
                       | <unsigned_numeric_literal> : <unsigned_numeric_literal>

Example

Specifying a Single Value for a Variable

SELECT [Measures].members ON COLUMS,
       NON EMPTY [ODB_CUST].members ON ROWS
FROM [ODBOSCEN1/MKTBRANCH] SAP VARIABLES [ODBBRANC]
INCLUDING [ODB_BRANC].[CHEM]

Excluding a Single Value for a Variable

SELECT [Measures].members ON COLUMS,
       NON EMPTY [ODB_CUST].members ON ROWS
FROM [ODBOSCEN1/MKTBRANCH] SAP VARIABLES [ODBBRANC]
EXCLUDING [ODB_BRANC].[CHEM]

Specifying an Interval as a Value Area for a Variable

SELECT [Measures].members ON COLUMS,
       NON EMPTY [0CALYEAR].members ON ROWS
FROM [ODBOSCEN1/MKTCUST] SAP VARIABLES [ODBCUST]
INCLUDING [ODB_CUST].[B01]:[ODB_CUST].[C05]

Specifying a List of Values and Intervals for a Selection Variable

SELECT [Measures].members ON COLUMS,
       NON EMPTY [ODB_BRANC].members ON ROWS
FROM [ODBOSCEN1/MKTPROD] SAP VARIABLES [ODBPROD]
INCLUDING [ODB_PROD].[CP01230111] [ODBPROD]
INCLUDING [ODB_PROD].[LP10101190] [ODBPROD]
INCLUDING [ODB_PROD].[PP98010102]:[ODB_PROD].[PR48666001]

 

 

End of Content Area