Position of the substring within the text (0 = not found).
| Field | Value |
|---|---|
| Category | Text |
| Type | Scalar (operates value by value) |
| Arity | 2 to 3 arguments |
| Compiles to SQL (calculated column) | Yes |
| Version | Formula engine v3. |
Aliases#
Canonical name: LOCALIZAR. Accepted aliases (case-insensitive): search, find.
Syntax#
code
LOCALIZAR(expr; arg2; [arg3])All arguments are expressions.
Returns#
Number (position, 1-based; 0 when not found).
Null handling#
Not finding the substring returns 0 (it's not an error).
Evaluation context#
Scalar — evaluated on the result of the arguments (in calculated columns, it runs row by row).
Differences from DAX#
- DAX equivalent: SEARCH / FIND
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: Returns 0 when not found (DAX SEARCH/FIND returns an ERROR). It is always case-insensitive — including via the
findalias, which would be case-sensitive in DAX.
Examples#
code
LOCALIZAR("SP"; uf)Example with values#
Input: searches for "SP" in "RJ-SP-MG".
code
LOCALIZAR("SP"; "RJ-SP-MG") → 4Expected result: 4
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.