question

maya avatar image
maya asked

MDX UNION get message: Members, tuples or sets must use the same hierarchies in the UNION function.

I have written MDX query and have problem with UNION. How to do it? Thanks in advance SELECT NON EMPTY { [Measures].[amounnt] } ON COLUMNS, UNION ( {descendants( [Date].[Year].CURRENTMEMBER, [Date].[Year])}, { descendants( [Date].[Month].CURRENTMEMBER, [Date].[Month])}, ALL) DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, MEMBER_VALUE ON ROWS FROM [BI] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS Executing the query ... Query (26, 3) Members, tuples or sets must use the same hierarchies in the UNION function. Execution complete I want to have a result: Year and month amount 2014 10 February 2014 3 April 2014 2 July 2014 5 2015 20 January 2015 2 February 2015 8 March 2015 10
ssrsmdxunion
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Martin Schoombee avatar image
Martin Schoombee answered
The use of the union function is not required here, especially since you're just trying to return all years and months from your date hierarchy. Try something like this: SELECT NON EMPTY { [Measures].[amounnt] } ON COLUMNS , { {[Date].[Year].members} * {[Date].[Month].members} } ON ROWS FROM [BI]
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

maya avatar image maya commented ·
Thanks Martin :) It works.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.