Returns the ancestor at the specified generation or level of the current member being calculated in the specified dimension. If you specify the optional mbrName, that ancestor is combined with the specified member.
This member set function can be used as a parameter of another function, where that parameter is a member or list of members.
@ANCEST (dimName, genLevNum [, mbrName])
|dimName||Single dimension name specification.|
|genLevNum||An integer value that defines the generation or level number from which the ancestor value is returned. A positive integer defines a generation number. A value of 0 or a negative integer defines a level number.|
|mbrName||Optional. Any valid single member name or member combination, or a function that returns a single member or member combination, that is crossed with the ancestor returned.|
Sales(@ANCEST(Product) = 5;);
Sales = @ANCEST(Product,2);
Sales = @ANCESTVAL(Product,2);
Sales = @AVG(SKIPMISSING, @ISIBLINGS(@ANCEST(Product,2)));
In the Sample Basic database:
Function Generated List @ANCEST(Product,2,Sales) Colas->Sales, if the current member of Product being calculated is Diet Cola. @ANCEST(Measures,3,East) Total Expenses->East, if the current member of Measures being calculated is Payroll.