Returns a set that is based on the relative position of the specified member in the database outline.
Note: | When multiple hierarchies are enabled, this function returns NULL when the range begins in one hierarchy and terminates in another hierarchy. |
Syntax
RelMemberRange ( member, prevcount, nextcount, [,layertype] [, hierarchy ])
| Parameter | Description |
|---|---|
An input member in the set you want to return. | |
prevcount | The number of members in the same layer specified by layertype prior to member to include in the return set. |
nextcount | The number of members in the same layer specified by layertype following member to include in the return set. |
layertype | GENERATION or LEVEL. If omitted, the default is GENERATION. Defines whether the set to be returned is based the same generation or on the same level as member. |
Optional. A specific hierarchy within the time dimension. |
Example
The following examples are based on ASOSamp.Sample.
SELECT RelMemberRange ([PORTLAND - OR],1,2) ON COLUMNS FROM asosamp.sample
This query returns the set:
{[PHOENIX - OR],[PORTLAND - OR],[POWERS - OR],[PRAIRIE CITY - OR]}RelMemberRange(Apr, 5, 0)
returns the set {Jan, Feb, Mar, Apr}. Note that the output set has only four members.
RelMemberRange(Apr, 5, 10)
returns the set {Jan, Feb, Mar, Apr, May ...,Dec}. Note that the output set has only four previous members and seven next members of Apr.
See Also