@IANCESTORS

The @IANCESTORS calculation function for Essbase returns a member and its ancestors, optionally up to a certain generation or level.

This function returns the specified member and either all ancestors of the member or all ancestors up to the specified generation or level.

Essbase sorts the generated list of members—starting with the specified member, followed by the nearest ancestor of the member, followed by the next nearest ancestor of the member, and so on. In the Sample.Basic database, if you specify @IANCESTORS(200-30), Essbase returns 200-30, 200, Product (in that order). When using this function with certain forecasting and statistical functions, you must consider order.

You can use this function as a parameter of another function, where the function requires a list of members.

Syntax

@IANCESTORS (mbrName [, genLevNum | genLevName])

Parameters

mbrName

Valid member name, or a function that returns a member.

genLevNum

Optional. The integer value that defines the absolute generation or level number up to which to select members. A positive integer defines a generation number. A value of 0 or a negative integer defines a level number.

genLevName

Optional. The level or generation name up to which to select members.

Example

All examples are from the Sample.Basic database.

@IANCESTORS("New York")

Returns New York, East, Market (in that order).

@IANCESTORS(Qtr4)

Returns Qtr4, Year (in that order).

@IANCESTORS(Sales,-2)

Returns Sales, Margin, Profit (in that order). Members higher than level 2 are not returned.

@IANCESTORS("100-10",1)

Returns 100-10, 100, Product (in that order). All ancestors are returned up to generation 1.