select
CASE LOWER(channel)
WHEN 'sem' THEN
CASE
WHEN (LOWER(SPLIT(campaign_name,'_')[SAFE_OFFSET(9)]) = 'us') THEN 'us independents'
WHEN (LOWER(SPLIT(campaign_name,'_')[SAFE_OFFSET(9)]) = 'intl') THEN 'intl independents'
WHEN (LOWER(SPLIT(campaign_name,'_')[SAFE_OFFSET(9)]) = 'part') THEN 'partners'
WHEN (LOWER(SPLIT(campaign_name,'_')[SAFE_OFFSET(9)]) = 'invest') THEN 'domain investors & registrars'
WHEN campaign_name IS NOT NULL or channel IS NOT NULL THEN
(select (business_unit)
from dgapbigquery.bi_reports.channel_campaign_exception_lookup)
ELSE 'unknown'
END
END
from
gdgapbigquery.bi_reports.channel_campaign_exception_lookup
问问题
31 次