We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Check if first 6 characters are same as on a list

HarryRoles
7 - Meteor

Hi All,

 

Hoping someone could advise which tool and formula to use for the following scenario:

 

I need to identify if the first 6 characters of a string match to something on a list, so basically a vlookup but only for the first 6 characters in the string e.g. if a 9 number string has 111111, 123456, 999999 etc as the first six digits.

 

123456777 - YES

999999000 - YES

777778907 - NO

 

Hope this makes sense!

 

Cheers

 

Harry

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @HarryRoles,


I have created a workflow for you:

 

Emil_Kos_0-1611834602217.png

 

The output:

 

Emil_Kos_1-1611834611006.png

 

 

Please mark my post as a solution if this was helpful!

AngelosPachis
16 - Nebula

Hi @HarryRoles ,

 

To parse the first 6 digits, you can convert you source into a string data type and use a formula tool with a function called Left, which will return X characters from the left of the string.

 

Then, with a Find & Replace tool, you can lookup if the first 6 digits match and append the flag of "Yes".

 

AngelosPachis_0-1611834612903.png

 

Hope that helps,

 

Angelos

mbarone
16 - Nebula
16 - Nebula

Many ways to do this.  I'd probably go with a left function to create a new field for the first 6 characters, then join them to your reference file, and there they join would be your "YES", and where they don't would be your "NO".

Labels
Top Solution Authors