Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Add whitespace and change beginning of words to uppercase

beatrizmguerreiro
8 - Asteroid

Hello, 

 

i have the situation below:

 

DATAC  LEASING TOOL AND JOIN TOOL & Summarize

 

And I need the output to be:

 

Data Cleasing Tool and Join Tool & Summarize

 

Most of the word will be uppercase, in the beginning and also eliminate that extra whitespace between the "C" and "L". I have tried the Data Cleansing Tool and Formulas, but no success. 

 

Can somebody help me to fix this? 

5 REPLIES 5
messi007
15 - Aurora
15 - Aurora

@beatrizmguerreiro,

 

Please see below:

messi007_0-1610038288528.png

Attached the workflow,


If this solves your issue please mark the answer as correct, it will help others!

Regards,

beatrizmguerreiro
8 - Asteroid

It worked. 

 

However I still have that extra whitespace. 

I added a data cleasing tool and it clean all trialing whitespaces. However, after using a filter tool, the field shifts. It adds a whitespace and I can't seem to understand the reason.

AngelosPachis
16 - Nebula

Hi @beatrizmguerreiro ,

 

From what I understand from your question, it's not just a matter of removing the whitespace between "C" and "LEANSING" but also re-assign it to the previous word, correct?

 

If you totally remove the whitespace, then DATAC LEANSING would return DATACLEANSING, 

 

but 

 

you are looking to get DATA CLEANSING.

 

Is that right?

Greg_Murray
12 - Quasar

Hi @beatrizmguerreiro

 

This expression in a formula tool should do the trick. Not this is not dynamic and and will only work for strings that match the example you gave. The regex_replace bit replaces 2 or more spaces with nothing and the replace part handles the space error between 'data' and 'cleansing'.

 

Replace(REGEX_Replace([YOUR_FIELD_HERE], '\s{2,}', ''),'DATAC','DATA C')

 

 

Hope that helps,

Greg 

beatrizmguerreiro
8 - Asteroid

Yes, correct

Labels