First N characters.
| Field | Value |
|---|---|
| Category | Text |
| Type | Scalar (operates value by value) |
| Arity | 2 arguments (fixed) |
| Compiles to SQL (calculated column) | Yes |
| Version | Formula engine v3. |
Aliases#
Canonical name: ESQUERDA. Accepted aliases (case-insensitive): left.
Syntax#
code
ESQUERDA(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: LEFT
- Compatibility: Compatible with DAX
- Note: First N characters.
Examples#
code
ESQUERDA(cnpj; 2)Example with values#
Input: "12345678", first 2.
code
ESQUERDA("12345678"; 2) → "12"Expected result: "12"
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.