2015-05-07 84 views
0

我有我想要對其進行過濾,在這樣的維度的一個字段的最大的查詢:如何篩選的MDX尺寸

SELECT 
    { 
    [Measures].[F Sra Quantity], 
    [Measures].[F Sra Gross], 
    [Measures].[F Sra Disc TOTAL] 
    } 

DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME 
ON COLUMNS, 

NON EMPTY 

CrossJoin( 
     {[Branch Dim].[b Name].Children}, 
     {[Date Dim].[d Year Month].Children}, 
     {[Date Dim].[Full Date].Children}, 
     {[Customer Dim].[c Name].Children}, 
     {[Customer Dim].[c Path].Children}, 
     {[Order Specification Dim].[Os Type No].Children}, 
     {[Sales Team Dim].[Id].Children}, 
     {[Sales Team Dim].[St Visitor].Children} 
     ) 

ON ROWS 

FROM [D Sys Warehouse] 

我想篩選就在[操作系統類型的最大值否]其成員總是在變化。你能幫我嗎?

+0

你的意思,你只希望有最大輸出中的[Os Type No]的值是多少? – SouravA

+0

是的,當然[Os類型號]對於所有三個度量值都是非空值。 – mana

回答

0

未測試因爲我不靠近SSASAdvWrks立方體,但這些方針的東西可能會奏效,假設我已經正確地解釋你的要求:

WITH MEMBER [Measures].[MAX_No] AS 
    MAX(
    [Order Specification Dim].[Os Type No].MEMBERS, 
    [Order Specification Dim].[Os Type No].CURRENTMEMBER.MEMBER_VALUE 
) 
SELECT 
    { 
    [Measures].[F Sra Quantity], 
    [Measures].[F Sra Gross], 
    [Measures].[F Sra Disc TOTAL] 
    } 

DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME 
ON COLUMNS, 

NON EMPTY 

CrossJoin( 
     {[Branch Dim].[b Name].Children}, 
     {[Date Dim].[d Year Month].Children}, 
     {[Date Dim].[Full Date].Children}, 
     {[Customer Dim].[c Name].Children}, 
     {[Customer Dim].[c Path].Children}, 
     {[Order Specification Dim].[Os Type No].Children}, 
     {[Sales Team Dim].[Id].Children}, 
     {[Sales Team Dim].[St Visitor].Children} 
     ) 
HAVING 
    [Order Specification Dim].[Os Type No].CURRENTMEMBER.MEMBER_VALUE = [Measures].[MAX_No] 
ON ROWS 

FROM [D Sys Warehouse]