2011-09-22 133 views
0

我有以下層次:OLAP - 水平具有相同的名稱

<Dimension name="Locations"> 
<Hierarchy hasAll="true" allMemberName="All Locations" primaryKey="loc1Id" uniqueKeyLevelName="loc1Id"> 
    <Table name="OLAP_Budget"/> 
    <Level name="location1" column="location1" uniqueMembers="true"/> 
    <Level name="location2" column="location2" uniqueMembers="true" hideMemberIf="IfBlankName"/> 
    <Level name="location3" column="location3" uniqueMembers="true" hideMemberIf="IfBlankName"/> 
</Hierarchy> 

問題:

「LOCATION1」是通過不同的會計年度的出口,並在每個會計不同的孩子年。 我在列中顯示「fiscalYear」維度,但是當我選擇顯示特定財務年度的值時,它會顯示所有子財政年度的整體財政年度。

我該如何解決這個問題?

由於提前

+0

您好!你能添加一些截圖嗎? – Max

回答

0

好,SSAS不知道是什麼年和位置之間的關係是 - 這是不應該。通常情況下,你會有一些組合的數據,唯一的方法(除了將年份和位置放置在相同的維度和建立一個用戶定義的層次結構,我不會建議,因爲它聽起來不對),是寫你的查詢非空。例如:

SELECT 
{ 
    [Measures].[Some Measure]* 
    [Date].[Calendar].[Year].&[2011] 

} ON 0, 
{ 
    [Location].[Location 1].Members 
} ON 1 
FROM [Some Cube] 

顯示行上的所有位置,而不管它們是否有數據違反它們。但是,如果其修改爲:

SELECT 
{ 
    [Measures].[Some Measure]* 
    [Date].[Calendar].[Year].&[2011] 

} ON 0, 
NON EMPTY { 
    [Location].[Location 1].Members 
} ON 1 
FROM [Some Cube] 

然後你得到它具有數據在2011年這樣你可以得到你想要的結果的位置。