---
title: "list_distinct function in Strata | Oplema"
description: "Remove duplicates and missing values from a list, leaving each remaining value once. For example, list_distinct([1, 1, NULL, -3, 1, 5]) returns [5, -3, 1]."
url: "https://oplema.com/docs/strata/functions/list-distinct"
updated: "2026-11-04"
---

# list\_distinct

Remove duplicates and missing values from a list. The original order isn't kept.

Also available as array\_distinct.

## Try an expression

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

### Expression

```
list_distinct([1, 1, NULL, -3, 1, 5])
```

### Result

```
'[5, -3, 1]'
```

The expression returns `INTEGER[]`. 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 | \[5, -3, 1\] |

## Arguments and types

```
list_distinct(list)
```

**list**

List

Supported signatures (1)

```
list_distinct(list: T[]) → T[]
```

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

## Things to know

Duplicate and missing elements are removed. Don't rely on the order of the remaining elements; use list\_sort when order matters.

If the first argument is missing, the result is NULL.

### Sort the remaining values

```
list_sort(list_distinct([1, 1, NULL, 3, 2]))
```

'\[1, 2, 3\]'

## Related functions

[list\_approx\_count\_distinct

Calculate an approximate count of distinct values from the values in a list.

](https://oplema.com/docs/strata/functions/list-approx-count-distinct)[list\_avg

Calculate the arithmetic mean from the values in a list.

](https://oplema.com/docs/strata/functions/list-avg)[list\_bit\_and

Calculate the bitwise AND from the values in a list.

](https://oplema.com/docs/strata/functions/list-bit-and)[list\_bit\_or

Calculate the bitwise OR from the values in a list.

](https://oplema.com/docs/strata/functions/list-bit-or)

[Browse lists & arrays](https://oplema.com/docs/strata/functions#lists-&-arrays) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/list.html#list_distinctlist)

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