---
title: "translate function in Strata | Oplema"
description: "Replace each character of text that is in one set with the matching character from a second set. Use it in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/translate"
updated: "2026-11-04"
---

# translate

Swap individual characters: each character in the second argument becomes the character at the same position in the third. Characters with no counterpart are removed.

## Try an expression

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

### Expression

```
translate('12345', '143', 'ax')
```

### Result

```
'a2x5'
```

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 | a2x5 |

## Arguments and types

```
translate(string, from, to)
```

**string**

Text

**from**

Text

**to**

Text

Supported signatures (1)

```
translate(string: VARCHAR, from: VARCHAR, to: VARCHAR) → 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

[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)[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)[substring

Extract part of text, starting at a character position where 1 is the first character. Without a length, it continues to the end of the text.

](https://oplema.com/docs/strata/functions/substring)[ilike\_escape

Check whether text matches a LIKE pattern, ignoring uppercase and lowercase. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/ilike-escape)

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

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