Returns a number of characters from the end of a specified string.

## Sample usage

`RIGHT_TEXT(Campaign, 4)`

## Syntax

`RIGHT_TEXT( X, length )`

### Parameters

- `X` - a field or an expression of any type.
- `length` - The number of characters to include in the substring. `length` can be a field, an expression, or a literal value.

## Examples

| Example formula | Input | Output |
|---|---|---|
| ` RIGHT_TEXT(Campaign, 4) ` | Summer Sale | Sale |
| ` RIGHT_TEXT(Campaign, 5) ` | Summer Discount | count |

## Related resources

- [Calculated fields](https://docs.cloud.google.com/data-studio/about-calculated-fields)
- [Data Studio function list](https://docs.cloud.google.com/data-studio/function-list)