Dhivya
Dhivya

Reputation: 31

A set has been encountered that cannot contain calculated members error in MDX query

Am executing the below query in SSAS server,

*SELECT*   ([Measures].[Internet Average Sales Amount]) ON COLUMNS 
    FROM 
    (
      select [Measures].[Internet Average Sales Amount] on 0,
      [Product].[Category].[Category].members on 1
      *From [Adventure Works]*
    )

I got A set has been encountered that cannot contain calculated members error

Upvotes: 0

Views: 235

Answers (1)

GregGalloway
GregGalloway

Reputation: 11625

Try omitting the calculated measure in the subselect in the FROM clause:

SELECT   ([Measures].[Internet Average Sales Amount]) ON COLUMNS 
    FROM 
    (
      select [Product].[Category].[Category].members on 0
      From [Adventure Works]
    )

Actually the subselect is doing nothing in your query. You only need a subselect to do a multi-select filter. You are filtering to all categories which does nothing.

So you could simplify the query like this with the same results:

SELECT   ([Measures].[Internet Average Sales Amount]) ON COLUMNS
FROM [Adventure Works]

Upvotes: 1

Related Questions