---
title: "union_value function in Strata | Oplema"
description: "Create a UNION value with one member, labeled with the name you pass in. Write it as union_value(k := 1) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/union-value"
updated: "2026-11-04"
---

# union\_value

Create a union with one member. The tag comes from the name of the argument, as in union\_value(k := 1).

## Try an expression

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

### Expression

```
union_value(k := 'hello')
```

### Result

```
'hello'
```

The expression returns `UNION(k 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 | hello |

## Arguments and types

```
union_value(...)
```

Supported signatures (1)

```
union_value(...: ANY) → UNION
```

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

## Things to know

### The selected member can be missing

```
union_value(name := NULL::VARCHAR)
```

'NULL'

## Related functions

[union\_extract

Extract the value with the named tags from the union. NULL if the tag isn't currently selected.

](https://oplema.com/docs/strata/functions/union-extract)[union\_tag

Retrieve the currently selected tag of the union as an ENUM.

](https://oplema.com/docs/strata/functions/union-tag)

[Browse unions](https://oplema.com/docs/strata/functions#unions) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/union.html#union_valuetag-any)

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