---
title: "array_distance function in Strata | Oplema"
description: "Calculate the Euclidean distance between two fixed-size numeric arrays of the same size. Use it in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/array-distance"
updated: "2026-11-04"
---

# 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.

## Try an expression

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

### Expression

```
array_distance(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
```

### Result

```
1.7320508
```

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

## Arguments and types

```
array_distance(array1, array2)
```

**array1**

List

**array2**

List

Supported signatures (2)

```
array_distance(array1: DOUBLE[ANY], array2: DOUBLE[ANY]) → DOUBLE
array_distance(array1: FLOAT[ANY], array2: FLOAT[ANY]) → 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

[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\_cosine\_similarity

Computes the cosine similarity 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-similarity)[array\_inner\_product

Computes the inner product 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-inner-product)[array\_negative\_inner\_product

Computes the negative inner product 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-negative-inner-product)

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

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