Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3585

Inconsistent handling of MDX query axes - member vs set

$
0
0

Hi all,

 

I'm trying to build a XML/A client agaisnt SAP/HANA. I created a XML/A service definition (.xsxmla file) in HANA studio, and I can succesfully access the service and do DISCOVER requests, and execuve MDX statements.

 

The problem I encounter executing MDX is as follows: I can succesfully execute a query like:

 

SELECT {[Measures].[PRICE_EACH]} ON 0
,      {[AT_PRODUCT_001].[HIER_PRODUCT1].&[S10_1678]} ON 1
FROM   [AN_ORDER_001]

 

(Get the Price Each for the product with the key S10_1678 across all other dimensions)

 

But when I try to add a WHERE clause (slicer axis) like so:

 

SELECT {[Measures].[PRICE_EACH]} ON 0
,      {[AT_PRODUCT_001].[HIER_PRODUCT1].&[S10_1678]} ON 1
FROM   [AN_ORDER_001]
WHERE  {[AT_TIME_001].[HIER_TIME1].&[2003-01-06]}

 

I get a SOAP Fault response, with an error message that reads:

 

Error in XMLA Statement: Error occurred while executing a MDX statement. The error message is: [Where clause] expects a parameter that return a [Set: {(...)}]. ["Tuple", "Property", "Member"] return a Set

 

What is this error message trying to tell me? As far as I can see, this MDX statement is valid - all axes have a set of members, that happens to contain just one member. It is clear that this poses no problem on the COLUMNS and ROWS axis, why is it a problem for the slicer axis?


For this particular example, I have found a work-around by not using the curly braces for the slicer axis, i.e. this query:

SELECT {[Measures].[PRICE_EACH]} ON 0
,      {[AT_PRODUCT_001].[HIER_PRODUCT1].&[S10_1678]} ON 1
FROM   [AN_ORDER_001]
WHERE  [AT_TIME_001].[HIER_TIME1].&[2003-01-06]

executes successfully and delivers the expected result.

 

It gets weirder: when I apply the same change to the column axis, i.e. remove the curly braces and write only the one member instead of a SET, like so:

SELECT [Measures].[PRICE_EACH] ON 0
,      {[AT_PRODUCT_001].[HIER_PRODUCT1].&[S10_1678]} ON 1
FROM   [AN_ORDER_001]
WHERE  [AT_TIME_001].[HIER_TIME1].&[2003-01-06]

I get a new SOAP Fault, with the error message:

Error in XMLA Statement: Error occurred while executing a MDX statement. The error message is: [Columns Axis, EMPTY] expects a parameter that return a [Measure: [Measures].[PRICE_EACH]]. ["Property", "Set", "Tuple"] return a Member

(If I put the curly braces back on the COLUMN AXIS, and remove them from the ROW axis, I get again an error with similar message)

What is up with that? Why is the behavior not consistent? And why is the behavior not according to the MDX standard?


Viewing all articles
Browse latest Browse all 3585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>