---
title: "coalesce function in Strata | Oplema"
description: "Return the first value that isn't missing from the arguments you pass in. Write it as coalesce(expr, ...) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/coalesce"
updated: "2026-11-04"
---

# coalesce

Replace missing values with the first available alternative.

## Try an expression

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

Example input

1. Row 1 `name = 'Ada'`
2. Row 2 `name = NULL`
3. Row 3 `name = ''`

### Expression

```
coalesce(name, 'Unknown')
```

### Result

```
Row 1: 'Ada'
Row 2: 'Unknown'
Row 3: ''
```

NULL means the value is missing.

Try it live in Formula

Result
| id | name | result |
| --- | --- | --- |
| 1 | Ada | Ada |
| 2 |  | Unknown |
| 3 |  | Unknown |

## Arguments and types

```
coalesce(expr, ...)
```

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

## Things to know

### An empty string is a value

```
coalesce('', 'Unknown')
```

Every row: ''

## Related functions

[IS NULL

Find missing values without confusing them with empty text.

](https://oplema.com/docs/strata/functions/is-null)[if

Choose between two values using a condition.

](https://oplema.com/docs/strata/functions/if)[ifnull

Use a fallback when a value is missing.

](https://oplema.com/docs/strata/functions/ifnull)[nullif

Turn a sentinel value, such as zero or an empty string, into a missing value.

](https://oplema.com/docs/strata/functions/nullif)

[Browse conditions & missing values](https://oplema.com/docs/strata/functions#conditions-&-missing-values) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/utility.html#coalesceexpr)

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