Extracts 4-digit year from messy text, returns -1 if undetermined
Per-row — runs once for each row.
CLEAN_YEAR({{ text }})| name | type | description |
|---|---|---|
| text | VARCHAR | Raw text to extract year from |
Fiscal year cleaned
SELECT
clean_year ('FY2023')Approximate year cleaned
SELECT
clean_year ('circa 1990')Decade start
SELECT
clean_year ('the 90s')ISO date component
SELECT
clean_year ('2024-03-15')Unparseable returns -1
SELECT
clean_year ('garbage')Remove or mask personally identifiable information from text
Type-cast messy real-world values that trip up standard CAST
Return the canonical/official form of a value (auto-detects entity type)
LLM-backed year extraction (escape hatch for CLEAN_YEAR)
Pick the best non-null value from a group (quality-aware COALESCE)
Fill in missing parts of a partial value using context
Extracts 4-digit year from messy text, returns -1 if undetermined
Per-row — runs once for each row.
CLEAN_YEAR({{ text }})| name | type | description |
|---|---|---|
| text | VARCHAR | Raw text to extract year from |
Fiscal year cleaned
SELECT
clean_year ('FY2023')Approximate year cleaned
SELECT
clean_year ('circa 1990')Decade start
SELECT
clean_year ('the 90s')ISO date component
SELECT
clean_year ('2024-03-15')Unparseable returns -1
SELECT
clean_year ('garbage')Remove or mask personally identifiable information from text
Type-cast messy real-world values that trip up standard CAST
Return the canonical/official form of a value (auto-detects entity type)
LLM-backed year extraction (escape hatch for CLEAN_YEAR)
Pick the best non-null value from a group (quality-aware COALESCE)
Fill in missing parts of a partial value using context