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
6 - Meteoroid

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
16 - Nebula
16 - Nebula

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

Carolyn
9 - Comet

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
6 - Meteoroid

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

Carolyn
9 - Comet

@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 :) 

Labels