RIGHT

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the last n characters from a string.

Syntax 

1right(<string>, <n>)

Arguments 

Required 

  • <string>: The source string.
  • <n>: The number of characters to return. When negative, returns all but the first |n| characters.

Returns 

Returns a text value that contains the rightmost characters.

Considerations 

  • If exceeds the length of the string, returns the entire string.

Examples 

Get Last Characters 

Extract the last two characters.

1SELECT right('abcde', 2) AS result;

Returns 'de'.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!