I need to create a formula that evaluates a field based on the information contained. Example:
A field contains my search campaign for each product as well as an indicator if brand search:
Campaign:
[search] product a
[search] product b
[search] product c
[search] product d
[search][brand] product a
[search][brand] product b
[brand] product c
…and so forth.
I want to append a column that essentially says if the campaign field contains [search] AND [brand] then “branded search” else if campaign field contains [search] then “non brand search” else "something else (or keep going for the various types of breakouts). I need to make sure that not all fields return with the same output since all fields contain the word “[search]”
The above example table output would be:
Campaign: OUTPUT field:
[search] product a non brand search (since it ONLY contains search, not brand)
[search] product b non brand search (same as above)
[search] product c non brand search (same as above)
[search] product d non brand search (same as above)
[search][brand] product a brand search (contains search AND brand)
[search][brand] product b brand search (contains search AND brand)
[brand] product c something else since ONLY contains brand, not brand and
search, or search only for non brand (and alert that possibly
campaign was set up incorrectly).
I used column expression but getting an error:
if (contains(column(“Campaign name”),“[search]”)) AND (contains(column(“Campaign name”), “[brand]”)),
{“brand search”}
else if (contains(column(“Campaign name”),“[search]”)),
{“non brand search”}
else {“unknown”}