Returns the specified member in a list of members.
|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).|
If mbrIndex is 0 or out of bounds, the script or member formula fails during verification or runtime and returns an error.
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.
Because @CHILDREN(“100-10”) is an empty list, returns an error.