---
title: "list_slice function in Strata | Oplema"
description: "Extract a section of a list or text by start and end positions, where 1 is the first position. For example, list_slice([4, 5, 6], 2, 3) returns [5, 6]."
url: "https://oplema.com/docs/strata/functions/list-slice"
updated: "2026-11-04"
---

# list\_slice

Extract a section of a list or text by start and end positions, where 1 is the first position. Negative positions count from the end.

Also available as array\_slice.

## Try an expression

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

### Expression

```
list_slice([4, 5, 6], 2, 3)
```

### Result

```
'[5, 6]'
```

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, 6\] |

## Arguments and types

```
list_slice(list, begin, end, step)
```

**list**

Any value

**begin**

Any value

**end**

Any value

**step**

Number

Supported signatures (2)

```
list_slice(list: ANY, begin: ANY, end: ANY) → ANY
list_slice(list: ANY, begin: ANY, end: ANY, step: BIGINT) → ANY
```

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\_to\_string

Join the values in a list into one string using a separator.

](https://oplema.com/docs/strata/functions/array-to-string)[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)[array\_to\_string\_comma\_default

Join the values in a list into comma-separated text.

](https://oplema.com/docs/strata/functions/array-to-string-comma-default)[array\_value

Creates an ARRAY containing the argument values.

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

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

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