2011-11-10 10 views
0

私のキューブの1つのディメンションから返された結果を制限するMDXクエリを作成しようとしていますが、1つの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] 

これが実行されますが、何も返さない、私が代わりに実行することができます。私は正しい結果セットを与えるが、今では集約され

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] 

をインデックス> Imnt Ctryここで私は単にインデックスが必要です。

さらに、私はセットを宣言して交差を使用しようとしましたが、交差点はセットと同じ次元を宣言しなければなりません。

これは実行したい論理的な操作だと思われますが、私はそれを得ることができません。

答えて

1

スライスセクションを使用します。

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]}) 
関連する問題