---
title: "list_histogram function in Strata | Oplema"
description: "Count how often each value appears in a list and return the counts as a map. For example, list_histogram([3,3,9]) returns {3=2, 9=1}."
url: "https://oplema.com/docs/strata/functions/list-histogram"
updated: "2026-11-04"
---

# list\_histogram

Calculate a frequency map from the values in a list.

## Try an expression

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

### Expression

```
list_histogram([3,3,9])
```

### Result

```
'{3=2, 9=1}'
```

The expression returns `MAP(INTEGER, UBIGINT)`. 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 | {3=2, 9=1} |

## Arguments and types

```
list_histogram(l)
```

**l**

Any value

Supported signatures (1)

```
list_histogram(l: 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

[list\_approx\_count\_distinct

Calculate an approximate count of distinct values from the values in a list.

](https://oplema.com/docs/strata/functions/list-approx-count-distinct)[list\_avg

Calculate the arithmetic mean from the values in a list.

](https://oplema.com/docs/strata/functions/list-avg)[list\_bit\_and

Calculate the bitwise AND from the values in a list.

](https://oplema.com/docs/strata/functions/list-bit-and)[list\_bit\_or

Calculate the bitwise OR from the values in a list.

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

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

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