Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

New Column based on a Condition with output reference from Another Column

DVikas
7 - Meteor

HI All ,

 

I have below Table having Suppliers in 3 different Columns & Type in the last as shown below :

 

 

Supplier 1Supplier 2Supplier 3Final Type
XXXXYYYYXXXXGRIP 4
AAAABBBYYYYM12 Pins
BBBBCCCCZZZZ1/4 Pin

 

I need to Add the Final Supplier Column based on the Final Type . If , Type Contains "GRIP" , reflect the Supplier from Supplier 1 Field , if Type Contains "M12" reflect the Supplier from Supplier 2 & if it Contains "1/4" then Supplier 3.

 

Desired Output below :

 

Supplier 1Supplier 2Supplier 3Final TypeFinal Supplier
XXXXYYYYXXXXGRIP 4XXXX
AAAABBBYYYYM12 PinsBBB
BBBBCCCCZZZZ1/4 PinZZZZ

 

I tried using the Formula tool , however it doesn't refer the value from a Column . May be I am using an incorrect Tool.

 

 

3 REPLIES 3
grazitti_sapna
17 - Castor

Hi @DVikas , is this what you are trying to achieve?

 

Formula - if Contains([Final Type],"GRIP") then [Supplier 1] elseif Contains([Final Type],"M12") then [Supplier 2]
elseif Contains([Final Type],"1/4") then [Supplier 3] else null() endif

grazitti_sapna_0-1599128411791.png

 

Sapna Gupta
DVikas
7 - Meteor

Thanks @grazitti_Sapna 

 

I tried doing the same thing , however didn't work. But I don't know how , it works now. Thanks for the help.

grazitti_sapna
17 - Castor

@DVikas , you are welcome, there might be a minor error in the logic written, if you want we can validate your logic in order to check what was the mistake?

Thanks.

Sapna Gupta
Labels
Top Solution Authors