IsAncestor

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])
ParameterDescription

member1

A member specification.

member2

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

Example 1

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
MarketEast
10552224161

Example 2

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]}
MarketEastFlorida
105522241615029