cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a MDX query in SAP HANA Studio

Former Member
0 Kudos

Hello, every one. Now I work on the SAP HANA Studio of CloudShare platform, I try to execute a mdx query in the HANA Studio Sql console editor, the mdx sql like this:

MDX

select

{

([Measures].[NetAmount]),

([Measures].[TaxAmount])

}

on columns

from AN_PURCHASE_OVERVIEW;

But, the query only returns a GUID column: 525EEB0B172B5FE4E10000000AA00064

Why this happens? Is there any problem with my mdx query statement? Please help me, this problem has been bothering me for several days,thank you very much!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member205400
Active Participant
0 Kudos

So I executed this series of sql:


set 'MDX_CATALOG_NAME' = 'testing';

MDX SELECT

{

[MEASURES].STO_OPEN_QUANTITY

} on COLUMNS,

{

[WERKS].MEMBERS

} on ROWS

from [CA_PFEP_STO_ALL];

MDX GET_AXISDATA 1 546DD7D434738C9CE1000000C6070FEB;

MDX GET_CELLDATA 546DD7D434738C9CE1000000C6070FEB;

MDX GET_AXISDATA 1 546DD7D434738C9CE1000000C6070FEB;

and they all produce data, but what I'm not getting is why this is? I see in the backend that the threads being generated to produce the pieces.

Is it like this so the 3rd party app can piece it together? It looks to me that HANA is breaking down the MDX into pieces and executing it.

So I'm not getting the reason for setting the MDX_CATALOG_NAME and the GUID's.

Can anyone explain?

I'd like to just produce a resultset from the MDX Select.

Mike

0 Kudos

Please try statements like the following:

MDX GET_CELLDATA 525EEB0B172B5FE4E10000000AA00064

MDX GET_AXISDATA 0 525EEB0B172B5FE4E10000000AA00064

MDX GET_AXISINFO 525EEB0B172B5FE4E10000000AA00064

References:

[1] http://scn.sap.com/thread/3144213

Former Member
0 Kudos

Thanks Dinu, I tried the MDX query statements in SAP HANA studio and the query like the following:

MDX GET_CELLDATA 525EEB0B172B5FE4E10000000AA00064

MDX GET_AXISDATA 525EEB0B172B5FE4E10000000AA00064

MDX GET_AXISINFO 525EEB0B172B5FE4E10000000AA00064


None of them get back data but display error message:


Could not execute 'MDX GET_CELLDATA 525EEB0B172B5FE4E10000000AA00064' in 348 ms 605 µs .

SAP DBTech JDBC: [259]: invalid table name:  Could not find table/view MDX_CELLDATA_525EEB0B172B5FE4E10000000AA00064 in schema _SYS_BIC: line 1 col 26 (at pos 25)

I don't know why I don't get data, is there any problem with mdx query?

Prior thanks!


Best Regards.


-David

0 Kudos

The GUID should the one that is returned from MDX SELECT in the same session and do not forget to close the request represented by the GUID. Please go through the discussion in thread http://scn.sap.com/thread/3144213. You will be able to get an entry level idea how to work with MDX in HANA. But, MDX is at best left to tools to generate.