MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 24: Multidimensional Expressions


 

Member Value Expressions

<member>.{PARENT | FIRSTCHILD | LASTCHILD | PREVMEMBER | NEXTMEMBER}

<member>.LEAD(<index>)

Gives the member that is <index> positions away along the member's dimension, in the dimension's natural order. The numbering of the positions is zero-based.

The function <member>.LAG is similar, except that it looks in the opposite direction. If <index> is negative, then LEAD becomes LAG, and vice versa.

<dimension>[.CURRENTMEMBER]

Gives the current member along <dimension>. The concept of "currency" occurs in functions such as GENERATE, where the semantics include some form of iteration through members of a set.

<member>.{FIRSTSIBLING | LASTSIBLING}

Returns the first/last sibling at the parent level of the <member>. For example,

May.FIRSTSIBLING

returns April, and the expression

May.LASTSIBLING

returns June (assuming that the parent level is quarters).

ANCESTOR(<member>, <level>)

Returns the ancestor of <member> at the specified level.

COUSIN(<member>, <ancestor_member>)

This function is best illustrated by an example: The expression

COUSIN([1996].March, [1994])

yields the member [1994].March.

The algorithm to evaluate the COUSIN function call is as follows:

COUSIN(<member1>, <member2>)

The three possible scenarios are as follows:

  1. If the level of <member2> is not at a higher level than <member1>, return immediately. Higher level means a lower level number, because level numbers start at the root (whose level is zero) and increase towards the leaf.

  2. If <member2> is a direct ancestor of <member1>, <member1> returns.

  3. Otherwise: