---
title: "right function in Strata | Oplema"
description: "Return the last characters of text, up to the given count. Write it as right(string, count) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/right"
updated: "2026-11-04"
---

# right

Return the last characters of text, up to the given count.

## Try an expression

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

### Expression

```
right('Hello🦆', 3)
```

### Result

```
'lo🦆'
```

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 | lo🦆 |

## Arguments and types

```
right(string, count)
```

**string**

Text

**count**

Number

Supported signatures (1)

```
right(string: VARCHAR, count: BIGINT) → VARCHAR
```

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

[left

Return the first characters of text, up to the given count.

](https://oplema.com/docs/strata/functions/left)[lpad

Add a character to the left of text until it reaches a given length. Longer text is cut from the right to that length.

](https://oplema.com/docs/strata/functions/lpad)[right\_grapheme

Extracts the right-most count grapheme clusters.

](https://oplema.com/docs/strata/functions/right-grapheme)[rpad

Add a character to the right of text until it reaches a given length. Longer text is cut from the right to that length.

](https://oplema.com/docs/strata/functions/rpad)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#rightstring-count)

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