---
title: "list_select function in Strata | Oplema"
description: "Pick values from a list by position, using a second list of indexes to choose them. For example, list_select([10, 20, 30, 40], [1, 4]) returns [10, 40]."
url: "https://oplema.com/docs/strata/functions/list-select"
updated: "2026-11-04"
---

# list\_select

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

Also available as array\_select.

## Try an expression

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

### Expression

```
list_select([10, 20, 30, 40], [1, 4])
```

### Result

```
'[10, 40]'
```

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 | \[10, 40\] |

## Arguments and types

```
list_select(value_list, index_list)
```

**value\_list**

List

**index\_list**

List

Supported signatures (1)

```
list_select(value_list: T[], index_list: BIGINT[]) → T[]
```

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\_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\_intersect

Return the distinct items that appear in both lists.

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

Find the position of a value in a list, where 1 is the first item. Returns a missing value if it isn't found.

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

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

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