Reputation: 35
I have two queries with a common Members, Rows and Columns:
WITH
MEMBER [Measures].[AliasMeasure1] as [Measures].[F],format_string='#,0'
MEMBER [Measures].[AliasMeasure2] as SUM({ParallelPeriod([Time].[E].[Year],1,[Time].[E].[Year].&[2018]) : ParallelPeriod([Time].[E].[Year],1,[Time].[E].[Year].&[2018])},[Measures].[AliasMeasure1])
MEMBER [Measures].[Growth] as ([Measures].[AliasMeasure1]-[Measures].[AliasMeasure2])/ABS( [Measures].[AliasMeasure2] ),format_string='#,0.00%'
Select
{FILTER({NONEMPTY([RegionGlobal].[Region].[Total]) *[Area].[SDR].[Total],
NONEMPTY([RegionGlobal].[Region].CHILDREN - [RegionGlobal].[Region].&[MD]) *[Area].[SDR].CHILDREN},
NOT ISEMPTY([Measures].[AliasMeasure1])) *{[Measures].[AliasMeasure1],
[Measures].[Growth]}} on columns,
FILTER([CP].[PDR].MEMBERS,NOT ISEMPTY([Measures].[AliasMeasure1])) on rows
One of the query have this subselect:
FROM (
SELECT
{[Time].[E].[Year].&[2018]:[Time].[E].[Year].&[2018]} on 0,
{[RegionGlobal].[Region].[Total]} on 1,
{[Area].[Area].[Total]} on 2,
{[Global_LI].[isLI].&[1]} on 3 FROM CUBE )
The second query is very similar:
FROM (
SELECT
{[Time].[E].[Year].&[2018]:[Time].[E].[Year].&[2018]} on 0,
{[RegionGlobal].[Region].&[USA]} on 1,
{[Area].[Area].&[AUSA]} on 2 FROM CUBE )
How can I merge it into one query? I try to create a Where but there are different dimensions.
Thanks in advance
Upvotes: 2
Views: 253
Reputation: 2911
Your sub-selects have diffrent hierarchility and dimensionality . I have balanced them in the query below. You can use this as your sub-select
SELECT
{[Time].[E].[Year].&[2018]:[Time].[E].[Year].&[2018]} on 0,
{
([RegionGlobal].[Region].[Total],[Area].[Area].[Total],[Global_LI].[isLI].&[1]),
([RegionGlobal].[Region].&[USA],[Area].[Area].&[AUSA],[Global_LI].[isLI].defaultmember)
}
on 1
FROM CUBE
Upvotes: 2