Logo

Getting Started

  • Installation
  • What is a Daitum Model?
  • Quickstart

Tutorials

  • Introduction to Modelling
  • Data Stores
  • Data Processors
  • Reports
  • Integration
  • Templates & Versioning
  • Best Practices

API Documentation

  • daitum-model
    • Quickstart
    • Model Builder
    • Tables
    • Fields
    • Named Values
    • Data Types
    • Formulas
      • The Formula Class
      • Built-in Formula Functions
        • ABS
        • AND
        • ARRAY
        • ARRAYMAX
        • ARRAYMIN
        • AVERAGE
        • BINOMDIST
        • BINOMINV
        • BITAND
        • BITMASK
        • BITMASKSTRING
        • BITOR
        • BLANK
        • CEILING
        • CHAR
        • CHOOSE
        • CONST
        • CONTAINS
        • COS
        • COUNT
        • COUNTBLANKS
        • COUNTDUPLICATES
        • DATE
        • DATETIME
        • DAY
        • DAYSBETWEEN
        • DISTINCT
        • DISTRIBUTE
        • EOMONTH
        • EXP
        • FILTER
        • FIND
        • FINDDUPLICATES
        • FLOOR
        • FROMTIMEZONE
        • GAMMADIST
        • GAMMAINV
        • GET
        • HOUR
        • HOURSBETWEEN
        • IF
        • IFBLANK
        • IFERROR
        • INDEX
        • INTEGER
        • INTERSECTION
        • ISBLANK
        • ISERROR
        • LEFT
        • LEN
        • LOG
        • LOOKUP
        • LOOKUPARRAY
        • LOWER
        • MATCH
        • MAX
        • MEDIAN
        • MIN
        • MINUTE
        • MOD
        • MONTH
        • MONTHSBETWEEN
        • NEXT
        • NORMDIST
        • NORMINV
        • NOT
        • OR
        • PLUSDAYS
        • PLUSMINUTES
        • POWER
        • PREV
        • RANK
        • RIGHT
        • ROUND
        • ROW
        • ROWS
        • ROWVECTOR
        • SECOND
        • SETTIME
        • SIN
        • SIZE
        • STDEV
        • SUM
        • TEXT
        • TEXTJOIN
        • TIME
        • TOMAP
        • TOTIMEZONE
        • TRIM
        • UNION
        • UPPER
        • VALUES
        • WEEKDAY
        • WEIBULL
        • YEAR
  • daitum-ui
  • daitum-configuration
Daitum
  • daitum-model
  • Formulas
  • RIGHT
  • View page source

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:
  • input_string (Operand | str) –

    The string from which characters will be extracted. Can be a literal string, a field, formula, calculation, or parameter.

    Supported types:

    • STRING

    • STRING_ARRAY

  • length (Operand | int) –

    The number of characters to extract from the right of input_string. If negative, the formula evaluates to an error.

    Supported types:

    • INTEGER

    • INTEGER_ARRAY

Return type:

Formula

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.

Supported types:

  • STRING

  • STRING_ARRAY

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"]
Previous Next

© Copyright 2026, Daitum.