The ISANCESTOR function takes two list or time period values. It returns a Boolean value of TRUE if the first is an ancestor of the second. Ancestors of an item are its parent, its parent's parent, and so on.
Syntax
ISANCESTOR(Ancestor, Descendant)
Arguments
Argument | Data type | Description |
Ancestor | List, time period | The value to test whether it is an ancestor of the Descendant argument. |
Descendant | List, time period | The value to test whether it is a descendant of the Ancestor argument. |
The ISANCESTOR function returns a Boolean result.
Calculation engine functionality differences
In Polaris, the ISANCESTOR function returns a value of false when given a top-level item coupled with an orphan entity.
In the Classic Engine, this will return a value of true.
Examples
List example
In this example, a module has the Organization list on columns and line items on rows.
The Organization list is a hierarchical list with a top level of company. Within this list, regions are the parents of countries, and countries are the parents of cities.
The first line item, City, uses the ITEM function to return each location within the Organization list. Three further line items use the ISANCESTOR function to check whether these cities are part of the UK, France, or the EMEA region respectively.
London | Birmingham | Paris | Lyon | New York | Los Angeles | |
City | London | Birmingham | Paris | Lyon | New York | Los Angeles |
Part of UK?
| true | true | ||||
Part of France?
| true | true | ||||
Part of EMEA?
| true | true | true | true |
Time period example
In this example, the Dates list is on columns, and line items on rows. The Chosen Month and Chosen Quarter line items have the time period data type. The Quarter is Ancestor? has the Boolean data type and uses the ISANCESTOR function. This returns a Boolean value of TRUE if the value of Chosen Quarter is an ancestor of Chosen Month.
The final line item, Within Q3?, uses a direct reference to the time period of Q3 FY22 and checks whether it's the ancestor of Chosen Month.
Key Dates | Expiry Dates | |
Chosen Month | Feb 2022 | Jul 2022 |
Chosen Quarter | Q1 FY22 | Q1 FY22 |
Quarter is Ancestor?
| true | |
Chosen Month Within Q3 FY22?
| true |