---
title: "map function in Strata | Oplema"
description: "Create a map from a list of keys and a list of values. For example, map(['a', 'b'], [1, 2]) returns {a=1, b=2}. Works in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/map"
updated: "2026-11-04"
---

# map

Create a map from a list of keys and a list of values.

## Try an expression

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

### Expression

```
map(['a', 'b'], [1, 2])
```

### Result

```
'{a=1, b=2}'
```

The expression returns `MAP(VARCHAR, 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 | {a=1, b=2} |

## Arguments and types

```
map(keys, values)
```

**keys**

List

**values**

List

Supported signatures (2)

```
map() → MAP("NULL", "NULL")
map(keys: K[], values: V[]) → MAP(K, V)
```

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

[map\_extract\_value

Look up a key in a map and return its value, or a missing value if the key is absent. The key must have the same type as the map's keys.

](https://oplema.com/docs/strata/functions/map-extract-value)[map\_keys

List the keys of a map.

](https://oplema.com/docs/strata/functions/map-keys)[map\_values

List the values of a map.

](https://oplema.com/docs/strata/functions/map-values)[map\_contains

Check whether a map has a given key.

](https://oplema.com/docs/strata/functions/map-contains)

[Browse maps](https://oplema.com/docs/strata/functions#maps) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/map.html#map)

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