按一个MDX维度筛选,但显示另一个维度

按一个MDX维度筛选,但显示另一个维度,mdx,Mdx,我正在尝试编写一个MDX查询,它限制多维数据集的一个维度返回的结果,但显示另一个维度的聚合,有人知道这是否可行吗 我实际上想要执行的是: SELECT NON EMPTY Filter([Index].[Index].Members, [Imnt Ctry].[ImntCtry].CurrentMember.Name<>"GB") ON ROWS, NON EMPTY {[Measures].[T.SUM], [Measures].[B.SUM], [Measures].[L.SUM

我正在尝试编写一个MDX查询,它限制多维数据集的一个维度返回的结果,但显示另一个维度的聚合,有人知道这是否可行吗

我实际上想要执行的是:

SELECT
NON EMPTY
Filter([Index].[Index].Members, [Imnt Ctry].[ImntCtry].CurrentMember.Name<>"GB")
ON ROWS,
NON EMPTY {[Measures].[T.SUM], [Measures].[B.SUM], [Measures].[L.SUM], [Measures].[SBL.SUM], [Measures].[P.SUM], [Measures].[R.SUM], [Measures].[Coll.SUM], [Measures].[Long.SUM], [Measures].[Short.SUM], [Measures].[Firm.SUM], [Measures].[Net.SUM], [Measures].[PTH.SUM]} ON COLUMNS
FROM [PositionsCube]
选择
非空
筛选器([Index].[Index].Members,[Imnt Ctry].[ImntCtry].CurrentMember.Name“GB”)
排成一排,
列上的非空{[Measures].[T.SUM],[Measures].[B.SUM],[Measures].[L.SUM],[Measures].[SBL.SUM],[P.SUM],[Measures].[R.SUM],[Measures].[Coll.SUM].[Long.SUM],[Measures].[Short.SUM],[Measures].[Firm.SUM],[Net.SUM]。[PTH.SUM]}
从[位置]
这将执行但不返回任何内容,我也可以执行:

SELECT
NON EMPTY
Crossjoin([Index].[Index].Members, Filter([Imnt Ctry].[ImntCtry].Members, [Imnt Ctry].[ImntCtry].CurrentMember.Name<>"GB"))
ON ROWS,
NON EMPTY {[Measures].[T.SUM], [Measures].[B.SUM], [Measures].[L.SUM], [Measures].[SBL.SUM], [Measures].[P.SUM], [Measures].[R.SUM], [Measures].[Coll.SUM], [Measures].[Long.SUM], [Measures].[Short.SUM], [Measures].[Firm.SUM], [Measures].[Net.SUM], [Measures].[PTH.SUM]} ON COLUMNS
FROM [PositionsCube]
选择
非空
交叉联接([Index].[Index].成员,筛选器([Imnt-Ctry].[ImntCtry].成员,[Imnt-Ctry].[ImntCtry].CurrentMember.Name“GB”))
排成一排,
列上的非空{[Measures].[T.SUM],[Measures].[B.SUM],[Measures].[L.SUM],[Measures].[SBL.SUM],[P.SUM],[Measures].[R.SUM],[Measures].[Coll.SUM].[Long.SUM],[Measures].[Short.SUM],[Measures].[Firm.SUM],[Net.SUM]。[PTH.SUM]}
从[位置]
这给了我正确的结果集,但现在正在通过索引>Imnt Ctry进行聚合,我只需要索引

此外,我还尝试声明一个集合并使用交集,但交集必须声明与集合相同的维度,否则无法解析,因此不再使用


这似乎是一个需要执行的逻辑操作,但我就是做不到。

使用切片部分

WITH  
Set [FilterImnt] As (Filter([Imnt Ctry].[ImntCtry].Members, [Imnt Ctry].[ImntCtry].CurrentMember.Name<>"GB"))
SELECT
NON EMPTY
{[Index].[Index].Members} 
ON ROWS,
NON EMPTY {[Measures].[T.SUM], [Measures].[B.SUM], [Measures].[L.SUM], [Measures].[SBL.SUM], [Measures].[P.SUM], [Measures].[R.SUM], [Measures].[Coll.SUM], [Measures].[Long.SUM], [Measures].[Short.SUM], [Measures].[Firm.SUM], [Measures].[Net.SUM], [Measures].[PTH.SUM]} ON COLUMNS
FROM [PositionsCube]
Where ({[FilterImnt]})
与
将[FilterImnt]设置为(筛选器([Imnt Ctry].[ImntCtry].Members,[Imnt Ctry].[ImntCtry].CurrentMember.Name“GB”))
挑选
非空
{[Index].[Index].Members}
排成一排,
列上的非空{[Measures].[T.SUM],[Measures].[B.SUM],[Measures].[L.SUM],[Measures].[SBL.SUM],[P.SUM],[Measures].[R.SUM],[Measures].[Coll.SUM].[Long.SUM],[Measures].[Short.SUM],[Measures].[Firm.SUM],[Net.SUM]。[PTH.SUM]}
从[位置]
其中({[FilterImnt]})