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

How to filter for a field containing "#A####" string pattern

BrandenHarbaugh
5 - Atom

Hello,

 

I'm trying to filter the description field (snip included) for anything that contains "#A####" string pattern within it ( 1 numeric, 1 alpha, 4 numeric).  Examples - 1C6001, 1H0327.  This can happen at the end, beginning, and in the middle of the string.  Any ideas on the formula I should put in the filter tool?

 

Thanks!

Branden

 

BrandenHarbaugh_0-1677855902950.png

 

4 REPLIES 4
ShankerV
17 - Castor

Hi @BrandenHarbaugh 

 

Below, I outlined the steps you can follow to build your own solution workflow.

 

Why should you try to build it yourself?

 

[1. It reduces professional risk] You might be tempted to copy a provided solution workflow. If you implement it without learning and understanding proper use, you risk it failing and being unable to fix it.

 

[2. You will increase personal proficiency] If you invest in understanding the concepts and build the solution yourself, you will be able to build workflow solutions better and more efficiently in the future.  

 

Build your own solution guide

1. Input your data with Column you want to process

2. Use the Filter tool, to derive the output.

REGEX_Match([Field1], '.+\d[A-Z]\d{4}')

 

We encourage you to try it yourself. Refer to the below section only if you are stuck

 

Spoiler
ShankerV_0-1677858035934.png

 

Kudos to you! If you were able to build the solution yourself :)

 

Please share with us if you were able to successfully build it or if you are facing any issues.

 

Happy to help :)

 

You can learn more about how to use Regex to build your own solution with the help of 

https://www.thedataschool.co.uk/kamilla-dombai/regex-in-alteryx

 

Many thanks

Shanker V

Christina_H
14 - Magnetar

Try using REGEX_Match([Description],".*\d\u\d{4}.*")

BrandenHarbaugh
5 - Atom

Dang, I was so close before I posted this!  Below is what I came up with on my own.  Thanks for the help and for providing me some resources to continue learning!

 

BrandenHarbaugh_0-1677858656403.png

 

Christina_H
14 - Magnetar

You were really close!  All you needed was the .* at each end since you're matching any part of the field.  Yours will match the whole field only.

Labels