我有抛出错误的 MDX 查询 - “在交叉连接函数中多次使用了 portalID 层次结构”
查询在 where 子句处失败
WHERE
(-{[SG Location].[PortalID].[30],
[SG Location].[PortalID].[46]},
[SG Location].[PortalID].[4],
[SG Program].[Campaign].&[*Cymbalta_Lilly (111)],
[Prints],
[SG Location].[IsTest].[0]
)
在上面的 where 子句中,动态附加以下条件(排除少数门户)
-{[SG Location].[PortalID].[30],
[SG Location].[PortalID].[46]}
请帮忙!我是 MDX 查询的新手。任何与 MDX 查询相关的有用链接——特别是关于 where 子句——都非常感谢。
下面是完整的 MDX 查询
WITH
MEMBER [SG Date].[Day].[TotPrintCount] AS
SUM(
{
[SG Date].[Day].&[2018-06-15],
[SG Date].[Day].&[2018-06-16],
[SG Date].[Day].&[2018-06-17],
[SG Date].[Day].&[2018-06-18]
},
[Measures].[Prints]
)
MEMBER [SG Date].[Day].[TotCustRev] AS
SUM(
{
[SG Date].[Day].&[2018-06-15],
[SG Date].[Day].&[2018-06-16],
[SG Date].[Day].&[2018-06-17],
[SG Date].[Day].&[2018-06-18]
},
[Measures].[CustRev]
)
MEMBER [SG Date].[Day].[TotLDMRev] AS
SUM(
{
[SG Date].[Day].&[2018-06-15],
[SG Date].[Day].&[2018-06-16],
[SG Date].[Day].&[2018-06-17],
[SG Date].[Day].&[2018-06-18]
},
[Measures].[LDMRev]
)
MEMBER [Measures].[RevRatio] AS [Measures].[LDMRev] / [Measures].[Transactions] * 1000
MEMBER [Measures].[MatchRatio] AS SUM([Measures].[PaidPrints]) / SUM([Measures].[Transactions]) * 100
SELECT {
[SG Date].[Day].[TotPrintCount],
[SG Date].[Day].&[2018-06-15],
[SG Date].[Day].&[2018-06-16],
[SG Date].[Day].&[2018-06-17],
[SG Date].[Day].&[2018-06-18],
[SG Date].[Day].[TotCustRev],
[SG Date].[Day].[TotLDMRev]}
ON COLUMNS, NON EMPTY
{
{ [SG Location].[Hierarchy].[Portal].ALLMEMBERS } * { [SG Program].[Hierarchy].ALLMEMBERS }
} ON ROWS FROM [ScriptGuide]
WHERE
(-{[SG Location].[PortalID].[30],
[SG Location].[PortalID].[46]},
[SG Location].[PortalID].[4],
[SG Program].[Campaign].&[*Cymbalta_Lilly (111)],
[Prints],
[SG Location].[IsTest].[0]
)