FIRST

For each parent record, returns the value from the first child record. The child records are looked at in natural unsorted order.

FIRST ( <field_name> [, Index [, <filter_query>] ] )

  • field_name: The name of a field to return the value from.

  • index: The index of the record to return.

  • filter_query: A query string representing the domain of records to include.

Example: create a field on the CUSTOMER table that returns the product code of the second purchase that each customer bought in 1994.

FIRST( [PRODUCT.PRODUCT_CODE],2,[PRODUCT.PURCHASE YEAR] = "1994")