Parsing Session Campaign Data in Data Studio
-
I am trying to create a formula in Data Studio using RegEx that extracts the channel from the below URLs, all channels are passed as the first value before the first _
ppcnonbrand_sports_uk_google_ourwebsite_b5g5_onlinebetting
crm_sports_uk_email_ourwebsite_b5g5_welcomeemail4b_signin_0_0_0
crm_sports_uk_email_ourwebsite_superboost_221206crmuksportstuenewsletterb_bethere_221206_rnd_0
socialbrand_sports_uk_facebook_ourwebsite_none_carouselawareness_23852435274560534_23852435274610534_0_Facebook_Desktop_Feed_23852435274780534so from the above i want to return:
ppcnonbrand
crm
socialbrandI have tried the following but it only returns "null" for everything .. i'm all out of ideas, can anyone suggest something?
REGEXP_EXTRACT(Session Campaign, "^[^_]*")
-
I am trying to create a formula in Data Studio using RegEx that extracts the channel from the below URLs, all channels are passed as the first value before the first _
ppcnonbrand_sports_uk_google_ourwebsite_b5g5_onlinebetting
crm_sports_uk_email_ourwebsite_b5g5_welcomeemail4b_signin_0_0_0
crm_sports_uk_email_ourwebsite_superboost_221206crmuksportstuenewsletterb_bethere_221206_rnd_0
socialbrand_sports_uk_facebook_ourwebsite_none_carouselawareness_23852435274560534_23852435274610534_0_Facebook_Desktop_Feed_23852435274780534so from the above i want to return:
ppcnonbrand
crm
socialbrandI have tried the following but it only returns "null" for everything .. i'm all out of ideas, can anyone suggest something?
REGEXP_EXTRACT(Session Campaign, "^[^_]*")
I found a solution that worked:
REGEXP_EXTRACT(Session campaign, "^([^_]+)")