If contains, then xyz

Hi there,

I have a column that I need to categorize based off certain strings it contains. For example, here is sample data:

1:1ABM Ford
1:1 ABM US Foods
1:1 ABM Toyota
Linkedin: Brand Awareness
Linkedin: Dropbox
ABM 1:Many All target acc
Q2`20 Industry Webinar

And i’d like to be able to say if contains 1:1, then 1:1, if contains Linkedin, then Linkedin, If contains 1:Many, then 1:Many, else put whats currently in the column. I think in sql I would do a case when statement and use like% to do contains. Can I do this in sigma?

1 Like

You can get to what you are looking for using a combination of a If and Contains. You could also use Like for more complex matching.
In sigma, If statements can have any number of matching If-Then pairs, and you can optionally add an else statement as the last argument.

This formula should work for you, just replace [COLUMN] with your column name.
If (Contains( [COLUMN], "1:1"), "1:1", Contains( [COLUMN], "LinkedIn"), "LinkedIn", Contains( [COLUMN], "1:Many"), "1:Many", [COLUMN])