RIGHT
- RIGHT(input_string, length)[source]
Returns a substring consisting of the rightmost characters from a string.
This function mimics the behavior of Excel’s RIGHT function. It extracts a substring from the end of input_string, searching backwards up to the number of characters specified by length. Both singular values and arrays are supported. If any argument is blank or in an error state, the formula evaluates to an error.
- Parameters:
- Return type:
- Returns:
The substring consisting of the rightmost characters of input_string up to index. If either input is an array, an array of substrings is returned.
- Raises:
ValueError – if input_string is not of type STRING or STRING_ARRAY.
ValueError – if index is not of type INTEGER or INTEGER_ARRAY.
Examples
Basic usage:
RIGHT("Hello World", 5) # Returns "World"
Using a Field or Formula:
RIGHT(customer["name"], 3) # Returns last three characters of the customer's name
With array input:
RIGHT(["Apple", "Banana", "Cherry"], 2) # Returns ["ue", "le", "ry"]
``input_string`` — accepted types
STRING
STRING_ARRAY
``length`` — accepted types
INTEGER
INTEGER_ARRAY
Return types
STRING
STRING_ARRAY