Alteryx Designer Desktop Discussions

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

To always add a space before every "("

quinnteoh
5 - Atom

Hello everyone!

 

Just wondering if anyone knows how to add a space before every occurrence of a "(" that is directly attached to a word without a space?

 

For example:

Amanda does not have a space before "(", so we should add one space for her, while Eric remains as it is:

 

Student InfoUpdated Student Info
Eric (12345)Eric (12345)
Amanda(45678)Amanda (45678)

 

 

Thank you in advance 😍

3 REPLIES 3
AgusEP
7 - Meteor

something like this?

Spoiler
Add Space Reply.JPG

KGT
11 - Bolide

REGEX is the quickest and most succinct for a one tool solution, however you can make it more "explainable" with the below:

 

  • You could filter the data looking for Contains([Student Info],' (').
  • The false will then give you all the records that don't contain the space/bracket combo.
  • A formula to replace([Student Info],"("," (") should then put a space before each open bracket.
  • Union to bring it back together.

The REGEX replace in the regex tool would be something like ([A-z])(\() with Replacement Text being $1 \( if you wanted to go that way.

 

Note: Sorry I just noticed this is tagged Designer Cloud. I'm not totally sure the above will work in Designer Cloud as I don't know the product, but my answer is relevant to Designer Desktop.

quinnteoh
5 - Atom

Both methods work perfectly!

 

 

Thank you all so much 😍

Labels