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.

How to match two columns

Sshasnk
8 - Asteroid

Hi I have two columns where I have to match and based on the condition I have to remove the records which do not satisfy 

 

prd_idcodecode_2
123PBINT
123PB

TK

345PB

TK

345CKNY
789PBINT

 

Condition:

1. if code and code_2 has PB and INT, that whole record (prd_id) is a pass like prod_id 123

2. 345 record does not have PB and INT so it is as exception

Output:

prd_idresult
123pass
789pass
345exception

 

 

2 REPLIES 2
Qiu
20 - Arcturus
20 - Arcturus

@Sshasnk 
Like this?

CaptureB3.PNG

SeanAdams
17 - Castor
17 - Castor

as per @Qiu 's solution - treat this like you would do in Excel.   For each of your tests you can create a column using the formula tool for the result of the test (Yes or No; true or false), and then just filter out the rows that don't pass your test.

Using this method you can build some very robust rules in a transparent way.

 

So for your data the rule would be in a formula tool - a new field called "Rule1Pass", with a type of String

 

if [code]=='PB' and [code_2] = 'INT' then 'Pass'

else 'Exception'

endif

 

 

 

 
Labels