使用parent-child dimension時,若parent本身也有數值時,則measure會彙總本身及其下的members數值。
現在有個需求想要在某張表中,排除parent本身的數值。
https://docs.microsoft.com/zh-tw/analysis-services/multidimensional-models/parent-child-dimension-attributes?view=asallproducts-allversions 
像這篇範例說的 ,Sales Manager 1 底下有Salesperson 1 和 Salesperson 2,彙總時,Sales Manager 1的值包含Sales Manager 1 本身及Salesperson 1 和 Salesperson 2的銷售額。
如果Sales Manager 1 只想要顯示 Salesperson 1 和 Salesperson 2時,則可以使用DataMember這個函數自訂一個member來逹成。 
WITH MEMBER measures.InvidualQuota AS   
([Employee].[Employees].currentmember.datamember, [Measures].[Sales Amount Quota])  
,FORMAT_STRING='Currency'  
SELECT {[Measures].[Sales Amount Quota],[Measures].InvidualQuota} ON COLUMNS,  
[Employee].[Employees].MEMBERS ON ROWS  
FROM [Adventure Works]  維度中若要排除paretn=child的顯示時,在MembersWithDta指定NonLeafDataHidden即可。
 
若不指定隱藏,則將如同此篇文章所示,parent本身也會顯示在child list中。
https://social.technet.microsoft.com/wiki/contents/articles/40299.ssas-parent-child-dimension.aspx
 
 
沒有留言:
張貼留言