Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

If Contains more than one statement

StefanvanWyk
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?

4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

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. 

StefanvanWyk
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.

Emil_Kos
17 - Castor
17 - Castor

Hi @StefanvanWyk,

 

I have created a solution for you:

 

Emil_Kos_0-1612259651194.png

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:

 

Emil_Kos_1-1612259705284.png

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

 

 

StefanvanWyk
7 - Meteor

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

 

I have marked your solution as the solution.😁

Labels