---
title: "enum_first function in Strata | Oplema"
description: "Get the first value defined in an enum type, such as the lowest level of a rating scale. Write it as enum_first(enum) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/enum-first"
updated: "2026-11-04"
---

# enum\_first

Returns the first value of the input enum type.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
enum_first(NULL::ENUM('sad', 'ok', 'happy', 'anxious'))
```

### Result

```
'sad'
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | sad |

## Arguments and types

```
enum_first(enum)
```

**enum**

Any value

Supported signatures (1)

```
enum_first(enum: ANY) → VARCHAR
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

### With a missing first argument

```
enum_first(NULL::ENUM('sad', 'ok', 'happy', 'anxious'))
```

'sad'

## Related functions

[enum\_last

Returns the last value of the input enum type.

](https://oplema.com/docs/strata/functions/enum-last)[enum\_range\_boundary

Returns the range between the two given enum values as an array. The values must be of the same enum type. When the first parameter is NULL, the result starts with the first value of the enum type. When the second parameter is NULL, the result ends with the last value of the enum type.

](https://oplema.com/docs/strata/functions/enum-range-boundary)[enum\_range

Returns all values of the input enum type as an array.

](https://oplema.com/docs/strata/functions/enum-range)[enum\_code

Returns the numeric value backing the given enum value.

](https://oplema.com/docs/strata/functions/enum-code)

[Browse enums](https://oplema.com/docs/strata/functions#enums) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/enum.html#enum_firstenum)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
