---
title: "list_distance function in Strata | Oplema"
description: "Calculate the Euclidean distance between two points given as numeric lists of equal length. For example, list_distance([1, 2, 3], [1, 2, 5]) returns 2.0."
url: "https://oplema.com/docs/strata/functions/list-distance"
updated: "2026-11-04"
---

# list\_distance

Calculates the Euclidean distance between two points with coordinates given in two inputs lists of equal length.

## Try an expression

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

### Expression

```
list_distance([1, 2, 3], [1, 2, 5])
```

### Result

```
2.0
```

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 |

## Arguments and types

```
list_distance(list1, list2)
```

**list1**

List

**list2**

List

Supported signatures (2)

```
list_distance(list1: DOUBLE[], list2: DOUBLE[]) → DOUBLE
list_distance(list1: FLOAT[], list2: FLOAT[]) → FLOAT
```

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

## Things to know

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

## Related functions

[list\_cosine\_distance

Computes the cosine distance between two same-sized lists.

](https://oplema.com/docs/strata/functions/list-cosine-distance)[list\_zip

Pair up items by position from two or more lists, returning a list of structs. Shorter lists are padded with missing values unless you set truncate, which stops at the shortest list.

](https://oplema.com/docs/strata/functions/list-zip)[array\_cosine\_distance

Computes the cosine distance between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.

](https://oplema.com/docs/strata/functions/array-cosine-distance)[array\_distance

Computes the distance between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.

](https://oplema.com/docs/strata/functions/array-distance)

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

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