Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

DIREITA

On this page (10)

Last N characters.

FieldValue
CategoryText
TypeScalar (operates value by value)
Arity2 arguments (fixed)
Compiles to SQL (calculated column)Yes
VersionFormula engine v3.

Aliases#

Canonical name: DIREITA. Accepted aliases (case-insensitive): right.

Syntax#

code
DIREITA(expr; arg2)

All arguments are expressions.

Returns#

Text.

Null handling#

Blank becomes empty text ("").

Evaluation context#

Scalar — evaluated on the result of the arguments (in calculated columns, it runs row by row).

Differences from DAX#

  • DAX equivalent: RIGHT
  • Compatibility: Compatible with DAX
  • Note: Last N characters.

Examples#

code
DIREITA(cnpj; 4)

Example with values#

Input: "12345678", last 4.

code
DIREITA("12345678"; 4)  →  "5678"

Expected result: "5678"

Business example#

Standardize records and labels — CNPJ, SKU, channel name, report legends.

Common errors#

Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.


← Back to the formula index

Related links