I wonder whether someone could help me please.
I'm trying to put together a BigQuery script in Standard SQL which finds given fields values and then replaces a specific value.
This is the script that I've put together:
SELECT
REGEXP_REPLACE(hits.eventInfo.eventLabel, r'.*\,','Apples') as eventLabel
FROM `bigquery.Test.ga_sessions_20181221`,
#hits are categorised as Arrays (REPEATED mode) in Standard SQL.UNNEST takes an ARRAY and returns a table with a single row for each element in the ARRAY.
UNNEST(hits) hits
WHERE REGEXP_CONTAINS(page.pagePath, r'^/dashboard/.*\properties|^/dashboard/inbox') and REGEXP_CONTAINS(EventInfo.eventLabel, r'.*\,')
The problem I have is that I'm able to create a new column called 'eventLabel', but I can't figure out a way to overwrite the existing 'hits.eventInfo.eventLabel' column.
Could someone perhaps have a look at this please and offer some guidance on where I've gone wrong.
Many thanks and kind regards
Chris
as eventLabelselectas hits.eventInfo.eventLabelhits.eventInfo.eventLabelfor some of the hits?