Alteryx Designer Desktop Discussions

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

If cell begins with ____ then ____

sswift13
7 - Meteor

I'm looking for data that begins with "0110" followed by several more numbers and some letters. I want to say if the data begins with "0110", then "comment" else "". Right now I have

IF REGEX_Match([column],'^0110\d+') then "comment" else "" endif

However this is not picking up anything. I'm assuming it has something to do with the 'd' in the formula. How can I adjust this so that it will find the correct information? Thanks!

6 REPLIES 6
mpennington
11 - Bolide

Does this work for you?

 

IIF(REGEX_Match([column], '^0110\d+.*'),'Comment','')
sswift13
7 - Meteor

Thanks for your quick reply, however, that did not solve the issue for me.

mpennington
11 - Bolide

Can you provide some sample text and expected results?  When I tested it with data as described, I got the result I was expecting. To be clear, the logic I am using is the exact 4 digits 0110 followed by at least 1 digit and then any number of digits or characters.  I could be missing something.

 

0110.jpg

sswift13
7 - Meteor

There is a space in my data which might be causing the problem.

CarliE
Alteryx Alumni (Retired)

It seems to be working for me. Is there a specific row that its not putting "comment" in for you? or is it not working at all? I have added a filter at the end to show values with "comment". See attached. 

 

If your data has spaces (the excel you shared seemed to work), try using the cleansing tool to clean up those spaces. 

Carli
mpennington
11 - Bolide

Yup, the extra space is the issue. 

 

IIF(REGEX_Match([CPSC], '^0110\d+.*\s*'),'Comment','')

 

Labels