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

Searching with the variable "*"

Luk88kk
8 - Asteroid

Good morning to all,

I am in the process of creating a report. I need to find in a huge table all the products that have numbers starting with *3211 and *2345, and under the * there can be hidden numbers 1,2,3,4, so I am interested in products starting with:
13211...
23211...
33211...
43211...

and
12345...
22345...
32345...
42345..
I currently manage to do this using the Filter tool. However, I wonder if it is possible to shorten the whole workflow significantly.

Could someone give me a hint as to whether it is possible to do something about it.

 

4 REPLIES 4
FinnCharlton
13 - Pulsar

Hi @Luk88kk , you can use RegEx for this! In your filter tool, use the formula:

 

Regex_Match([Field],'\d3211\d*')
OR
Regex_Match([Field],'\d2345\d*')

 

The \d matches any digit 0-9, and the numbers match themselves. Hope this helps!

Luk88kk
8 - Asteroid

Hi @FinnCharlton,

Thank you very much for your help. It works great!

Could I ask for some more help.
While working today, I noticed that some of the numbers may be in the middle of an number, for example:

547*13211787
or
55*232118888

Could you give me a hint as to what I should do in this case.

FinnCharlton
13 - Pulsar

@Luk88kk In this case, we can make a slight change to the RegEx:

Regex_Match([Field],'\d*3211\d*')
OR
Regex_Match([Field],'\d*2345\d*')

This will now match any number containing the sequence '3211' or '2345'

Luk88kk
8 - Asteroid

Hi,

Thank you very much for your help.

Have a great week!

Labels