# VALUES

The VALUES function returns the unique values from a field as a multivalued field. The order of the returned values is not guaranteed. If you need the values in a specific order, use the `MV_SORT` function.

## Syntax

`VALUES(field)`

### Parameters

#### field

The field from which to extract unique values.

## Examples

Extracts the first letter from each employee's first name, then groups employees by this letter and collects all unique first names for each group, sorting them alphabetically.

```esql
FROM employees
| EVAL first_letter = SUBSTRING(first_name, 0, 1)
| STATS first_name = MV_SORT(VALUES(first_name)) BY first_letter
| SORT first_letter
```

## Limitations

This function can use a significant amount of memory. Aggregations do not grow beyond available memory, so if the number of collected values exceeds memory limits, the query will fail with a Circuit Breaker Error. If you need to keep repeated values, use the `TOP` function instead.