Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Finding Data starting with P followed by four characters

sswift13
7 - Meteor

I am creating a formula that when the data matches a certain criteria, it adds a label to a new column.

 

I want to find all words in a certain column that begin with P and are followed by four digits. I have tried IF [column] = "P****" then "label" however this does not work but does not give me an error message. I am unsure of how Alteryx uses the asterisk/something else in order to show that I need four digits after the first letter.

 

Thank you.

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

Hi @sswift13 . You could try using the formula,

 

IF regex_match([column], 'P\d{4}.*')
then "label"
else Null()
endif

 

sswift13
7 - Meteor

Hi Philip,

 

Thank you but this did not work for my project.

pedrodrfaria
13 - Pulsar

Hi @sswift13 

 

Take a look at the workflow attached. It should either give you the solution or a good idea of how to get there.

 

Pedro.

PhilipMannering
16 - Nebula
16 - Nebula

Perhaps you could share some sample data (that's been sanitized if necessary)? I'm positive it can be amended to work for your use case.

Labels
Top Solution Authors