Any idea how we can automate this code. In the sense currently I checking for one by one dim_campaign_pca[campaignObjective] by hardcoding the value, so if any new value is added in the dim_campaign_pca[campaignObjective] then we have to update the code manually everytime, so to avoid this manual activity we need to automate it. We need you help for this.
campaignObjectiveKey =
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "APPIN"), "APPIN",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "APPRE"), "APPRE",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "AWA"), "AWA",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "CALIB"), "CALIB",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "CATSA"), "CATSA",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "CONSI"), "CONSI",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "CON"), "CON",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "ENG"), "ENG",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "EVENT"), "EVENT",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "FOLLOW"), "FOLLOW",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "FOLLW"), "FOLLW",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "INSTR"), "INSTR",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "LDS"), "LDS",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "MSG"), "MSG",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "MULTI"), "MULTI",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "PGLK"), "PGLK",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "PURC"), "PURC",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "REACH"), "REACH",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "REATRA"), "REATRA",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "SALE"), "SALE",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "STORE"), "STORE",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "TRAFF"), "TRAFF",
IF(CONTAINSSTRING(dim_campaign_pca[campaignObjective], "VID"), "VID",
dim_campaign_pca[campaignObjective])))))))))))))))))))))))