@RANGEFIRSTVAL

Returns the first value, in a range of the specified mbrList, that satisfies the criterion specified in the first function parameter.

Syntax

@RANGEFIRSTVAL(SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH, mbrList)
Parameter Description
SKIPNONE Every cell value is considered as data.
SKIPMISSING #MISSING values are not considered as data.
SKIPZERO Zero (0) values are not considered as data.
SKIPBOTH Zero (0) and #MISSING values are not considered as data.
mbrList A valid member name, a comma-delimited list of member names, cross dimension members, or a member set function that returns a list of members from the same dimension. If you use the range operator or a function, the order of mbrList is dictated by the database outline order.

Notes

The function returns #MISSING when mbrList does not contain any value matching the criterion specified in the first argument.

Example

Example 1

The following examples use the Sample.Basic database.

@RANGEFIRSTVAL(SKIPMISSING, @CHILDREN("Qtr1"));

or

@RANGEFIRSTVAL(SKIPMISSING, "Jan":"Mar");

or

@RANGEFIRSTVAL(SKIPMISSING, ("Jan","Feb","Mar"))

The previous statements return the first non-#MISSING value found when sequentially looking up the values of members Jan, Feb, and Mar.

Example 2

@RANGEFIRSTVAL(SKIPZERO, @CHILDREN("Jan"));

Because member Jan does not have children, returns #MISSING.

Example 3

@RANGEFIRSTVAL(SKIPBOTH, @CHILDREN("Qtr1"));

Returns the first non-#MISSING and nonzero Actual value from Qtr1, using the outline order. All months have data, so the value for Jan is returned.

Example 4

@RANGEFIRSTVAL (SKIPBOTH, (Actual->Feb, Actual->Mar, Actual->Jan ))

Returns the first non-#MISSING and nonzero Actual value from the given list of months, using the order given in mbrList. All months have data, so the value for Feb is returned.