mdxmdx-querysap-bw

How to include multiple items in "SAP VARIABLES"?


I'm new to developing queries in BW MDX. And I have a question that seems simple, but I can't find any documentation/solution anywhere.

I'd like to know how to add multiple "filters" for the same member in the "SAP VARIABLES" section of a query.

Let's say I have this query, for example:

SELECT
    NON EMPTY { [Measures].[ABCSXS] } ON COLUMNS,
    NON EMPTY { [0CAS].[LEVEL01].MEMBERS } DIMENSION PROPERTIES [0CAS].[20CAS] ON ROWS

FROM YYY54\BABSBABSASBAB

SAP VARIABLES [YPPCYEAR] INCLUDING [0FISCPER].[NG2023007]

In the SAP VARIABLES section, how do I "include" the values 2022006, 2021005 for YPPCYEAR?


Solution

  • SAP BW MDX, you can usually specify multiple values for a variable by separating them with a comma within the INCLUDING clause. However, the exact syntax and support may depend on the version and configuration of your SAP BW system.

    But here is an example:

    SAP VARIABLES [YPPCYEAR] INCLUDING [0FISCPER].[NG2023007], [0FISCPER].[NG2022006], [0FISCPER].[NG2021005]
    

    variable YPPCYEAR is set to include the values NG2023007, NG2022006, and NG2021005.