cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MDX Statement

Shikha12
Discoverer
0 Kudos
272

Hello Team

I have the requirement to write the MDX query from the Query and when writing the statement i could not get the Key and Description defined for the sales order (No and Text of the Sales order)

Tried with the below code snippet

Test 1 --[ZSALESORD].['Key'].MEMBERS *

Also tried this

Test 2--[ZSALESORD].[Key].MEMBERS *

[ZSALESORD].[Text].MEMBERS *

Get the error message when the code is executed/checked --

@5C\QError@ Value 'Key' for characteristic ZSALESORD unknown.

Can i request you to please let me know if the BEx query dimensions can be shown in both KEY and Text for MDX statement?

Many thanks

View Entire Topic
Savio_Dmello
Active Participant
0 Kudos

First, ensure that the dimension ZSALESORD has both the Key and Text attributes defined. You can do this in the InfoObject settings in SAP BW.

The error message you are receiving indicates that "Key" is not recognized. You should confirm the actual names of the attributes defined in your BW model. check if that value exists in info object P table by going in tcode se11.

The code will look like

WITH MEMBER [Measures].[SalesOrderKey] AS
[ZSALESORD].[Key].CurrentMember.Properties("KEY")
MEMBER [Measures].[SalesOrderText] AS
[ZSALESORD].[Text].CurrentMember.Properties("TEXT")
SELECT
{[Measures].[SalesOrderKey], [Measures].[SalesOrderText]} ON COLUMNS
FROM
[YourCube]

Shikha12
Discoverer
0 Kudos
Hello Savio