Replaces all occurrences of a substring.
| Field | Value |
|---|---|
| Category | Text |
| Type | Scalar (operates value by value) |
| Arity | 3 arguments (fixed) |
| Compiles to SQL (calculated column) | Yes |
| Version | Formula engine v3. |
Aliases#
Canonical name: SUBSTITUIR. Accepted aliases (case-insensitive): substitute, replace.
Syntax#
code
SUBSTITUIR(expr; arg2; arg3)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: SUBSTITUTE
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: Replaces ALL occurrences by content (like SUBSTITUTE). The
replacealias is NOT the position-based REPLACE from DAX/Excel.
Examples#
code
SUBSTITUIR(sku; "-"; "")Example with values#
Input: "A-B-C", replaces "-" with "".
code
SUBSTITUIR("A-B-C"; "-"; "") → "ABC"Expected result: "ABC"
Business example#
Clean up the SKU by removing hyphens before matching it against another dataset.
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.