Alteryx Designer Desktop Discussions

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

If a cell contains Text

DodgerFH
7 - Meteor

I am trying to clean some data before importing it into a file.  I CANNOT change the original source.   

 

Working on a Zip Code field,  but sometimes it contains letters for other countries.   Is there a way to highlight cells that contain text?  I am wanting to replace any cell that contains text with a zero.  Not sure how to specify in a formula that it is text.   

 

Any help appreciated

4 REPLIES 4
alexnajm
17 - Castor
17 - Castor

IIF(Regex_Match([Field],".*[[:alpha:]]+.*"),"0", [Field])

Carolyn
11 - Bolide

RegEx! 

 

You can use RegExMatch to flag when text is present and then filtered for when a non-number is found (I used \D = not a number - it'll catch spaces and special characters too)

 

     REGEX_Match([Zip], ".*\D.*")

 

You can use RegExReplace to replace a non-number with a 0

 

     REGEX_Replace([Zip], "\D", "0")

 

See attached workflow example

DodgerFH
7 - Meteor

Thanks! This worked perfectly.   Really appreciate the quick response.  Have a great day! 

Carolyn
11 - Bolide

@DodgerFH - Yay, glad it worked for you! Please mark your question as solved. You should be able to "accept as solution" for the reply/replies that solved it. It makes it easier for others to go right to the solution if they have the same question :) 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels