Free Trial

Alteryx Designer Desktop Discussions

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

How to Make a space after a comma

jenner85
8 - Asteroid

Hi,

I have a list of names and some of them may not be formatted correctly, so I need to be able to add a space after the comma. I am trying to do this with two formulas:

 

ReplaceChar([Name],","," ")

 

ReplaceChar([Name]," ",", ")

 

but what I am getting is a double comma between the last a first name.

 

Smith,Jennifer

Smith, Jennifer

 

Becomes:

Smith,,Jennifer

Smith,,Jennifer

 

thanks! 

5 REPLIES 5
jenner85
8 - Asteroid

Ok, I know what I did wrong - I should use replace string not char.

Emil_Kos
17 - Castor
17 - Castor

Hi @jenner85,

 

Replace function will work better for you:

 

Replace([Name], ',', ', ')

 

Emil_Kos_0-1624568727187.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @jenner85,

 

Happy to hear that you have nailed it! 

jenner85
8 - Asteroid

Hey @Emil_Kos  I hit another snag - this is now adding back a comma where there is a second name such as:

 

Smith, Jennifer Rose

 

Now is giving me 

 

Smith,  Jennifer, Rose

 

How would I go about only adding the comma back in after the first  word?

 

Emil_Kos
17 - Castor
17 - Castor

Hi @jenner85,

 

Please check if this works for you:

 

Emil_Kos_0-1624570041242.png

 

Labels
Top Solution Authors