祖項
Essbase 的 MDX 祖代函式會取得輸入成員與圖層或距離,並傳回一組祖代與輸入成員。
當圖層規格為層次時,此函數會傳回層次不大於輸入層次的所有祖代。例如,Ancestors ([Additions], [Measures].Levels(2)) 會傳回 {[Inventory] , [Additions]}。
語法
Ancestors ( member , layer | index )備註
-
index 不要使用負數。如果您要傳回較低的成員,請使用子代而非「祖代」。
Ancestors([Qtr1], -1)會傳回空白成員,而不是子代。 -
如果您使用圖層來指定層次,但該層次沒有祖代,則傳回值為空白成員。
範例
Ancestors ( [New York], [Market].levels(2) )傳回 {[Market], [East], [New York]},也就是從位於 Market 維度層次 2 的祖代開始的 [New York] 祖代的自含集合。
Ancestors ( [Feb], 1 )傳回 {[Qtr1],[Feb]},即從祖系 1 步高於 Feb 的自含祖系集。
Ancestors ( [Feb], 0 )傳回 {[Feb]}。
使用 ASOSamp.Basic 資料庫,
Ancestors ([94089], [Geography].generations(2))傳回 {[West], [CA], [SUNNYVALE - CA], [94089]},即從第二代 Geography 維度開始的自含 94089 祖代集。