@MEMBERAT

Returns the specified member in a list of members.

Syntax

@MEMBERAT(mbrList, mbrIndex)
Parameter Description

mbrList

Member list or function that returns a member list.

mbrIndex

Nonzero integer. If positive, enumerates from start of the list (for example, 1 returns the first member in the list). If negative, enumerates from the end of the list (for example, -1 returns the last member in the list).

Notes

If mbrIndex is 0 or out of bounds, the script or member formula fails during verification or runtime and returns an error.

Example

The following examples use the Sample.Basic database.

@MEMBERAT(@CHILDREN("Colas"), 1); returns 100-20 (Diet Cola).

Sales = @ MEMBERAT(@CHILDREN("Total Expenses"), -1);

The value of the member Misc is assigned to Sales, because Misc is the last child of Total Expenses, and the mbrIndex of -1 causes this function to select the last member in the list.

@MEMBERAT(@CHILDREN("100-10"), 1);

Because @CHILDREN("100-10") is an empty list, returns an error.

See Also