Returns the first (or several first) items in a list.
Function
result = first([count], input)
Arguments
Argument | Data Type |
count | integer |
---|---|
input | list |
result | list or single value of the input list's item type |
Comments
The default value for count is 1. Returns the first count records of the input list as a list of values if count is greater than 1; if count is equal to 1 then the return type is a single value of the same type as the input list's values.
This function is usually used with ordering to return a meaningful output. An example of this is shown below.
Examples
result = first([Direct Reports])
result = first(2, [Direct Reports])
result = first([Direct Reports] order by [Name])