Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How can you do a if contains formula based off two columns?

d_gilmer33
5 - Atom

I have two tables I'm joining, then using a formula tool where I want it to look at two columns (say column A and B), then using a filter tool. In the formula I want to say if a word in column B is in column A in row 1, then that row will return True and if not then False, and have that formula for every row in the table. The formula I've been trying is If Contains ([A], [B]) THEN "True" Else "False" ENDIF. However this formula is still returning False on rows where a word in column B is in column A. I'm not sure if I'm creating the formula incorrectly, or if there is a better way of doing this. I've attached a very generic workflow example of what I'm looking at doing. Any help is appreciated!

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Not on my computer so can’t build out a workflow for you. However, if you use the sample tool (select top N, N = 1) to get the first row of your column A, append that to the joined table and then base your filter on that then it should work!

binuacs
21 - Polaris

@d_gilmer33  Please see the syntax of the Contains function below, The target text length always less than or equal to the String. In your case the length of the Target is more than the length of String , which is always False

binuacs_0-1651505826968.png

 

 

binuacs
21 - Polaris

@d_gilmer33 One of the option is to split the store name and compare with Find and Replace tool

 

binuacs_0-1651506829335.png

 

Labels