---
title: "enum_range function in Strata | Oplema"
description: "List every value of an enum type in its defined order, such as [sad, ok, happy, anxious]. Write it as enum_range(enum) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/enum-range"
updated: "2026-11-04"
---

# enum\_range

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

## Try an expression

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

### Expression

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

### Result

```
'[sad, ok, happy, anxious]'
```

The expression returns `VARCHAR[]`. Formula stores it as `VARCHAR` in this example. 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, ok, happy, anxious\] |

## Arguments and types

```
enum_range(enum)
```

**enum**

Any value

Supported signatures (1)

```
enum_range(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_range(NULL::ENUM('sad', 'ok', 'happy', 'anxious'))
```

'\[sad, ok, happy, anxious\]'

## Related functions

[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\_first

Returns the first value of the input enum type.

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

Returns the last value of the input enum type.

](https://oplema.com/docs/strata/functions/enum-last)[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_rangeenum)

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