---
title: "list_reverse_sort function in Strata | Oplema"
description: "Sort the values in a list in reverse order, from largest to smallest. For example, list_reverse_sort([3, 6, 1, 2]) returns [6, 3, 2, 1]."
url: "https://oplema.com/docs/strata/functions/list-reverse-sort"
updated: "2026-11-04"
---

# list\_reverse\_sort

Sort the items in a list in reverse order. An optional argument sets where missing values go (NULLS FIRST or NULLS LAST).

Also available as array\_reverse\_sort.

## Try an expression

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

### Expression

```
list_reverse_sort([3, 6, 1, 2])
```

### Result

```
'[6, 3, 2, 1]'
```

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 | \[6, 3, 2, 1\] |

## Arguments and types

```
list_reverse_sort(list[, null_order])
```

**list**

List

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\_reverse

Reverse the order of values in a list. Also available as array\_reverse.

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

Sort the items in a list. Optional arguments set the order (ASC or DESC) and where missing values go (NULLS FIRST or NULLS LAST).

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

Run a named aggregate function, such as min or sum, over the items in a list.

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

Remove duplicates and missing values from a list. The original order isn't kept.

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

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

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