---
title: "list_intersect function in Strata | Oplema"
description: "Get the distinct values that appear in both of two lists, returned as a new list. For example, list_intersect([1, 2, 3], [2, 3, 4]) returns [2, 3]."
url: "https://oplema.com/docs/strata/functions/list-intersect"
updated: "2026-11-04"
---

# list\_intersect

Return the distinct items that appear in both lists.

Also available as array\_intersect.

## Try an expression

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

### Expression

```
list_intersect([1, 2, 3], [2, 3, 4])
```

### Result

```
'[2, 3]'
```

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 | \[2, 3\] |

## Arguments and types

```
list_intersect(list1, list2)
```

**list1**

List

**list2**

List

Supported signatures (1)

```
list_intersect(list1: T[], list2: T[]) → T[]
```

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

## Things to know

The result contains distinct shared values. Sort the result separately if you need a predictable element order.

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

### Sort the shared values

```
list_sort(list_intersect([1, 2, 3], [2, 3, 4]))
```

'\[2, 3\]'

## Related functions

[list\_filter

Keep the list items for which a lambda expression returns true. The lambda result must be convertible to BOOLEAN, and the output has the same type as the input list.

](https://oplema.com/docs/strata/functions/list-filter)[list\_has\_all

Check whether a list contains every item of a second list. Missing values are ignored.

](https://oplema.com/docs/strata/functions/list-has-all)[list\_select

Build a list from the items at the given positions, where 1 is the first item.

](https://oplema.com/docs/strata/functions/list-select)[list\_transform

Apply a lambda expression to each list item and return the results as a list. The item type of the output comes from the lambda result.

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

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

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