Alteryx Designer Desktop Discussions

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

Lookup using fuzzy logic to stamp data from reference file to existing file

Wixard
8 - Asteroid

 

Hi all,

 

Relatively new to Alteryx and looking for some guidance on how to go about doing the below! Hopefully there's a Pro for who this is a breeze!

 

I have 2 Excel files; a working file and a reference file

 

Working File:

 

Working File (Initial)
StatusNameIDUnitCode
ActiveJohn Smith LDA
PendingSarah Jane LDA
CompletePaul Crow LGHC
ActiveBecca Torrini HYT
PendingYT Smithson HYT
CompleteGeorgio Yan LGHC

 

Reference File:

 

Reference File (Unchanged)
ActivityNameIDUnitCode
AddSmith, John A.01234LDA
OutJane, Sarah768LDA
OutSmithson, Yan T.00678HYT
InTorini, Rebecca892HYT
OutYan, Georgio00765LGHC
OutCrow, Paul LGHC

 

What I want to do is:

 

If the Status in the Working file is "Active" AND the Activity in the Reference File is either "Add" or "In", I would like to lookup the Name and UnitCode to see whether I get a match.

 

If there is a match, then I would like to do 3 things:

 

1. Stamp the name as it appears in the Reference file, into the working file

2. Stamp the ID that exists in the Reference file into the Working File

3. Change the Status in the Working File from "Active" to "Complete"

 

The Working File will then look like this:

 

Working File (Updated)
StatusNameIDUnitCode
CompleteSmith, John A.01234LDA
PendingSarah Jane LDA
CompletePaul Crow LGHC
CompleteTorini, Rebecca00892HYT
PendingYT Smithson HYT
CompleteGeorgio Yan LGHC

 

There are 3 nuances.

 

1. The name may not always match exactly, as in the above examples.

2. The UnitCodes are non-unique, but serves as a good check to see if the name should have matched.

3. The ID should always be 5 digits long, so if the Reference file only has a 3 digit ID, I would like to add 0's in front to ensure it reaches 5 digits.

 

Any help would be hugely appreciated!

4 REPLIES 4
ArtApa
Alteryx
Alteryx

Hi @Wixard - I believe this workflow will do the job for you:

 

ArtApa_0-1625010957286.png

 

Wixard
8 - Asteroid

Hi ArtApa,

 

Thanks so much for this, its brilliant!

 

Quick clarification - what is the purpose of the RecordID? Is it to create a unique key for the fuzzy match?

 

 

ArtApa
Alteryx
Alteryx

Hi @Wixard - Yes, it's needed for Fuzzy matching, but also I used it to bring back unmatched records and sort in the original order. 

Wixard
8 - Asteroid

That makes sense! Thank you!! 😀

Labels