I want to UNION
the below MDX
query. For these two queries measures and dimensions are different for the same date range. Please help me to get out of this.
SELECT NON EMPTY { [Measures].[Number of es2] } ON COLUMNS,
NON EMPTY { ([Date].[Year].[Year].ALLMEMBERS * [Date].[Month].[Month].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date].[Date Hierarchy].[Date].&[20170101] : [Date].[Date Hierarchy].[Date].&[20180101] ) ON COLUMNS
FROM ( SELECT ( { [PracHistory].[Name].&[In] } ) ON COLUMNS FROM [Cube]))
WHERE ( [PracHistory].[Name].&[In] )
SELECT NON EMPTY { [Measures].[Number of es1] } ON COLUMNS,
NON EMPTY { ([Date].[Year].[Year].ALLMEMBERS * [Date].[Month].[Month].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date].[Date Hierarchy].[Date].&[20170101] : [Date].[Date Hierarchy].[Date].&[20180101] ) ON COLUMNS
FROM ( SELECT ( { [Prac].[Pra atus].&[ We] } ) ON COLUMNS FROM [Cube]))
WHERE ( [Prac].[Pra atus].&[ We] )
MDX doesnt support Union, However there is away around it.
1)You can write a query will show you on columns first "es2" for all values of "Pra atus" and "In" value for name. Then it will display "es1" for " we" value of "Pra atus" and all values of "Name". The columns will be side by side. The query will look as below. All values means the default value.
Sample for above
2)Now if you want it to Display in a single column, to emulate the behavior of SQL union then you will need a calculated measure that will select the value from one of the two measures .However please note that apart of the Date on rows you will also see "Name" and "Pra atus" on rows. The query will look like below.
Sample for above