Alteryx Designer Desktop Discussions

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

Detecting Whitespace in a V_WString

caltang
17 - Castor
17 - Castor

Hi folks!

 

Hope all is well. Does anyone know REGEX_MATCH to detect whitespace? I'm not trying to cleanse it, just detect it and take it out for further action as part of a workflow. 

 

Thanks!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
7 REPLIES 7
flying008
14 - Magnetar

Hi, @caltang 

 

Maybe you can upload sample data for input and output ?

 

REGEX_CountMatches([Txt], '\s')

 

caltang
17 - Castor
17 - Castor

I'm actually on my mobile right now, and just wanted something quick - thanks @flying008 will try it. If it fails, I'll upload a sample file tonight OR if it works I'll mark your comment as the solution

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
FinnCharlton
13 - Pulsar

Hey @caltang what do you mean by detect and take it out? Do you mean flagging when whitespace is present? Parsing it into another field?

caltang
17 - Castor
17 - Castor

Yes sir!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Unfortunately, that just removes everything with a space haha @flying008 

 

Not your fault, it was mine - I have uploaded a sample. 4th Tab is called "D Field " with a whitespace at the end. The consistent factor is, the whitespace is always at the end.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
FinnCharlton
13 - Pulsar

Hi @caltang , guess you could do it like this with the RegEx tool using Tokenize:

image.png

 

This splits the Field A into two fields, one with the whitespace and one with the rest of the string. If there is no whitespace at the end, Field A2 will be null, which will flag the field.

caltang
17 - Castor
17 - Castor

Thanks @FinnCharlton - you gave me a great idea! 

 

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels