# FIRST_VALUE() Function

### Description

Returns the first value in an ordered set of values

### Syntax

```sql
FIRST_VALUE(expression)
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _expression_ | Column or expression to evaluate | Any | Yes |

### Rewrite

Use QUALIFY to filter on window expression results; do not use window functions in WHERE.

#### Notes

-   Include an `OVER (...)` clause with `ORDER BY` (and optional `PARTITION BY`) when using this as a window function.

### Example

```sql
SELECT
    id, FIRST_VALUE(full_name) OVER (PARTITION BY department ORDER BY start_date) AS first_name
FROM
    rippling.employee.Employee;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/first_value

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
