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

Need help identifying data combination issues and correcting them

Jack5
6 - Meteoroid

Hi all,

 

I have two fields in a large data set that have variable inputs that are supposed to combine a certain way. From the instructions:

 

     Region:                                                 Country:
Europe                             France, Germany, Poland, Spain, Sweden, United Kingdom
North America                 Canada, Mexico, United States
South America                 Argentina, Bolivia, Brazil, Chile, Columbia, Venezuela

 

The country should be matched to its proper region, ex. Country - USA  then  Region - North America

 

Some the combinations in the dataset are wrong however, ex. Country - USA  then  Region - Europe

 

My question is, what tool/formula can I use in alteryx to identify these incorrect combinations and correct them in accordance with the chart above?

 

My file is attached. I already tried to create a formula with the formula tool to solve this issue but it didn't work. The formula tool I tried with is annotated ALTERYX COMMUNITY QUESTION.

 

Please help if you can.

6 REPLIES 6
MichalM
Alteryx Alumni (Retired)

@Jack5 

 

I'd create a Lookup table with the desired mapping between the Country and a Region and use the Join to append the correct Region - see the below and attached

 

MichalM_0-1607038026152.png

 

 

MichalM_0-1607037921777.png

 

Jack5
6 - Meteoroid

Thanks for your response @MichalM.

 

I've attached an updated file, adding in the tools you input on the separate sheet. I changed a couple small things to format to my data. Does it look like I incorporated all of those tools correctly?

 

 

MichalM
Alteryx Alumni (Retired)

Yes you did. What you could do is to get rid of the Text to Columns and Data Cleansing - I only used it to get the cleaned up lookup table using the one you provided. 

 

MichalM_0-1607040553225.png

 

 

Attached is what I have in mind

Jack5
6 - Meteoroid

That all works, thanks @MichalM for the help there. While we're at it, there is one more thing in my file I know needs to be fixed. In my "Join Multiple" tool that is furthest to the right (I've annotated it "TOO MANY RENAMED FIELDS"), there are a lot of fields from Input #2 that have been renamed, but that is not supposed to be the case. I'd appreciate it if you could help me make it to where that wasn't the case, thanks.

MichalM
Alteryx Alumni (Retired)

As you're only joining two streams of data, using the Join module will suffice. This will only rename the duplicated fields - Model and Series in this instance if you choose to include them twice.

 

MichalM_0-1607042267235.png

 

An alternative would be to use the Dynamic Rename module and configure it to remove the "Input_#2_" Prefix

 

MichalM_1-1607042396411.png

 

In both cases, you'll also need to reconfigure the Union following this step and use the Auto Config by Name option

 

MichalM_3-1607042484473.png

 

 

Jack5
6 - Meteoroid

That also worked perfectly, thanks again.

Labels