community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Selection based on Field

Meteor

Let say i have this dataset

 

Field1    Field2     Field3

123456 A12345  AA1234

222345 AA2234

                              AA3234

 

What I want to create are new column based on the value in the specific field, like if Field1 contain value and Field2 contain value and Field3 contain value then Field1 value, then if Field2 and Field3 then Field2 value. Lastly, if Field3 then Field3 value.What is the best practice to create the workflow.

Pulsar
Pulsar

Hey @rouzu! Try to add a Formula tool. Create a new field with the following expression.:

 

iif(contains([Field1],"AA") && contains([Field2],"AA") && contains([Field3],"AA"),[Field1],iif(Contains([Field2], "AA") && contains([Field3],"AA"),[Field2],iif(Contains([Field3], "AA"),[Field3],null())))

You can change the "AA" to whatever value you're testing for. Hope this helps!

Meteor

This error are happen when I insert the formula. Can you explain it

Pulsar
Pulsar

@rouzu make sure that all of your fields are strings first or use the tostring() formula in Alteryx. That should get rid of that error for you.

Meteor

Thanks I'm manage to do it. So, It is the best practice way to represent the output or have another trick to do it 

Labels