Returns TRUE if the first member is an ancestor of the second member and, optionally, if the first member is equal to the second member.
Syntax
IsAncestor ( member1 , member2 [, INCLUDEMEMBER])
| Parameter | Description |
|---|---|
A member specification. | |
A member specification. | |
INCLUDEMEMBER | Optional. Use this keyword if you want IsAncestor to return TRUE if the first member is equal to the second member. |
Example
The following query returns all Market dimension members for which the expression IsAncestor([Market].CurrentMember, [Florida]) returns TRUE; in other words, the query returns all ancestors of Florida.
SELECT Filter([Market].Members, IsAncestor([Market].CurrentMember, [Florida])) ON COLUMNS FROM Sample.Basic
| Market | East |
|---|---|
| 105522 | 24161 |
The following query is the same as the above query, except that it uses INCLUDEMEMBER. It returns all Market dimension members for which the expression IsAncestor([Market].CurrentMember, [Florida], INCLUDEMEMBER)) returns TRUE; in other words, the query returns Florida and all ancestors of Florida.
SELECT
Filter([Market].Members, IsAncestor([Market].CurrentMember, [Florida], INCLUDEMEMBER))
ON COLUMNS
FROM Sample.Basic
{[Market], [East], [Florida]}| Market | East | Florida |
|---|---|---|
| 105522 | 24161 | 5029 |