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

Find & Replace Across Multiple Columns Using Text Input Lookup

malves2011
5 - Atom

Hello,

 

This is my first time posting to the Alteryx community and I was looking for some assistance. I'm attempting to do a find and replace across multiple columns and want to bring in a numeric value to replace a text value. I'd like to essentially have a lookup performed on 4 different text inputs that contain the lookup text and corresponding value I'd like to replace. I've listed an example below for how my columns look and the 4 different manual input texts I've created.

 

AA1BB1CC1DD1EE1FF1GG1HH1AA2BB2CC2
AppleSugarTomatoMilkSugarTomatoAppleSugarAppleTomatoApple
BananaSaltCarrotJuiceSaltCarrotBananaSaltBananaCarrotBanana
OrangePepperBeanWaterPepperBeanOrangePepperOrangeBeanOrange
KiwiSugarCornSodaSaltCornKiwiPepperKiwiCornKiwi
           
           
FruitValue VegetableValue SpiceValue DrinkValue
Apple1 Tomato10 Sugar5 Milk7
Banana2 Carrot8 Salt4 Juice5
Orange3 Bean6 Pepper1 Water3
Kiwi4 Corn4    Soda0

 

Any assistance would be very much appreciated!

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

Hi @malves2011,

 

Welcome to the community!

 

here is a quick example how to do this:

 

grossal_0-1587757111083.png

 

Output:

grossal_1-1587757125266.png

 

 

What happens:

1) I add a Record ID

2) Transposing the data into rows

3) Union Tool with "Auto Config by Position"

4) Find and Replace to replace the value

5) Cross tab to bring them back into the original form

 

 

Workflow attached. Let me know what you think.

 

Best

Alex

malves2011
5 - Atom

Works great! Thanks!

grossal
15 - Aurora
15 - Aurora

That's great! @malves2011 

 

Would you mind accepting the post as a solution? This helps others to find it more quickly if they have similar problem.

Labels