Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Dan Gorman edited this page Nov 29, 2018 · 3 revisions

The RIGHT Function

Function Group: Text

RIGHT returns the rightmost segment of a string, as specified by a segment position argument.

Syntax

RIGHT(arg1, arg2)

  • arg1 is the string to be segmented
  • arg2 is optional, and is the point from the right at which to segment the strings (defaults to 1)

Uses

Let's say we're given a response with an id:

{  
   "data":{  
      "ids":{  
         "id_1": "1anb4amca051"
      }
   }
}

If we are only interested in the last 5 digits of the id, we can get them with RIGHT:

RIGHT(data.ids.id_1, 5)

which returns ca051.

Notes

To get characters from the left side of a string, use LEFT

Unlike LEFT, the segment position argument for RIGHT is counted from right to left, as opposed to left to right.

Clone this wiki locally