First Function (Reporting Services)

Returns the first value in the given scope of the specified expression.

Syntax

First(expression, scope)

Parameters

Return Type

Determined by the type of expression.

Remarks

The First function returns the first value in a set of data after all sorting and filtering have been applied at the specified scope.

The First function cannot be used in group filter expressions with anything except the current (default) scope.

You can also use First in a page header to return the first value from the ReportItems collection for a page in order to produce dictionary-style headings that display the first and last entries on a page.

The value of scope cannot be an expression and must refer to the current scope or a containing scope.

Example

The following code example returns the first product number in the Category group of a data region:

=First(Fields!ProductNumber.Value, "Category")