---
title: "ifnull function in Strata | Oplema"
description: "Return a fallback value when the first value is NULL. An empty string isn't NULL, so it's returned unchanged. Use it in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/ifnull"
updated: "2026-11-04"
---

# ifnull

Use a fallback when a value is missing.

## Try an expression

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

### Expression

```
ifnull(NULL, 'Unknown')
```

### Result

```
'Unknown'
```

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 | Unknown |

## Arguments and types

```
ifnull(expr, other)
```

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

```
ifnull('', 'Unknown')
```

''

## Related functions

[nullif

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

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

Check whether a value falls within an inclusive range.

](https://oplema.com/docs/strata/functions/between)[coalesce

Replace missing values with the first available alternative.

](https://oplema.com/docs/strata/functions/coalesce)[IS NULL

Find missing values without confusing them with empty text.

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

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

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