Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

If Contains more than one statement

7 - Meteor

Good Day,


I am trying to categorize certain transactions from bank statements.


However, there are multiple lines with different descriptions that would all be classified into the same category.


Within the example, the information that we use to categorize can either come from the extended description or beneficiary details columns. If these columns contain either "Birch", "Travel" or "Greyhound" it should be categorized as "Travel and Accommodation". 


Currently, I am using the following formula:

IF Contains([Expanded Description], "Greyhound") then "Travel and Accommodation" else if Contains([Beneficiary Details], "Greyhound") then "Travel and Accommodation" else [Category] endif endif


Any ideas?

16 - Nebula

Hi @StefanvanWyk,


Your formula contains a category and the data set don't have this column.


Can you also show us the expected output? I am not sure what is your goal. 

7 - Meteor

Hi Emil,


Thank you for your reply.


The expected output is as per the attached. Basically, I am creating a new column and then categorizing all the transactions.

16 - Nebula

Hi @StefanvanWyk,


I have created a solution for you:



The regex formula which I have used:


IF REGEX_Match([Beneficiary Details],".*(greyhound|birch|travel).*") OR REGEX_Match([Expanded Description] ,".*(greyhound|birch|travel).*")

THEN "Travel and Accommodation" else null() endif


I needed to change all the positions in those columns to lower case as I wasn't able to make it work without it. 


The output:



It took me some time to make it work so please mark this post as a solution if this was helpful 😀



7 - Meteor

@Emil_Kos this is brilliant. Thank you for your help!!


I have marked your solution as the solution.😁