I am creating a database of names in BigQuery. The source data provides the name in this format: last first middle (aka, no commas, only spaces).
What I want to end up with is last, first middle (essentially inserting a comma after the last name).
At first, I thought I’d need to do a REGEXP_EXTRACT after the first space.
Essentially:
CONCAT(SPLIT(REGEXP_EXTRACT(Teacher_Name, r’^[^ ]*’),’ ‘)) AS Teacher_Name
…but that’s not working as I get the error “Query error: Grouping by expressions of type ARRAY is not allowed at [21:25]”.
As a self taught BigQuerier, any help would be tremendously appreciated!
Mahler258 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.