2011-08-08 51 views
3

我是具有SSAS和SSRS的BI啓動器,我有一個非常基本的MDX問題。MDX不等於基本問題

獲得與計算成員中的條件相匹配的所有值非常容易。例如

WITH MEMBER [MEASURES].TOTAL_DOT_TEST 
AS 
(
[Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot  Classification].&[3], 
[Measures].[Fact Transportation Incident Count] 
) 

會得到有3

分類值然而交通事件的數量,使用這個例子中,我如何獲得交通事件的數量不具有的ID 3?

從表 喜歡的東西 SELECT * 其中分類<> 3

感謝

回答

3

您可以使用Aggregate()和Except()如下:

WITH MEMBER [MEASURES].TOTAL_DOT_TEST 
AS Aggregate ( 
     Except( 
     [Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot  Classification].members , 
     { [Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot  Classification].&[3] } 
    ), 
     [Measures].[Fact Transportation Incident Count] 
) 
+0

非常感謝!非常有用的答案 – Daniel