Alteryx Designer Desktop Discussions

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

Add a space in Formula

jhosmer002
7 - Meteor

I have a pretty easy question, hopefully. This formula works to combine First Name and Last Name from two fields into one. The Output is FnameLname and I would like a space between to be Fname Lname. How do I add the space? Thanks! 

 

IF IsNull([Contact Full Name]) THEN [CEO First Name]+[CEO Last Name] ELSE [Contact Full Name] ENDIF

 

 

 

7 REPLIES 7
JordyMicheal
11 - Bolide

Hi JHosmer!!

 

IF IsNull([Contact Full Name]) THEN [CEO First Name]+" "+[CEO Last Name] ELSE [Contact Full Name] ENDIF

 

Just a + " " + in between the lines you want to space.

Quote of a space 🙂


Hope that helps

jhosmer002
7 - Meteor

Thank you! I appreciate it! 

LarsDellen
6 - Meteoroid

Hm,

this is actually exactly what I tried, but in my case it was the result of a formula on phone numbers, where I wanted to add a blank space after the country code of a phone number.

The formula result being: +49123456789 should have resulted in +49 123456789

I used this formula:

[Country Code2] + " " + right(length([Phone corrected]-length([Country Code2]))

Country Code2= +49

phone corrected: +49123456789

The error is:

Error: Formula (93): Parse Error at char(157): Invalid type in operator ==. (Expression #3)

JordyMicheal
11 - Bolide

Hi @LarsDellen,

 

Don't know if you are still working on this but I would stand to guess your numbers are stored in integers.

Can't do "String" functions on "Numbers".


Grab a select too and convert it to a string and it should work.

Let me know if not!

LarsDellen
6 - Meteoroid

HI @JordyMicheal,

 

the field containing the phone number is in the format of V-WString as that oune seemed to be the right one (I need to have the plus symbol in there).

But adding a blank space in the formula ....+ " " +... results in errors. I've tried different type values, but this always seems to cause an error.

Any other ideas on how to integrate a blank space if not " "? 

LarsDellen
6 - Meteoroid

Hi @JordyMicheal,

 

the field containing the phone number is in the format of V-WString as that oune seemed to be the right one (I need to have the plus symbol in there).

But adding a blank space in the formula ....+ " " +... results in errors. I've tried different type values, but this always seems to cause an error.

Any other ideas on how to integrate a blank space if not " "? 

LarsDellen
6 - Meteoroid

....I found the solution...

it wasn't the blank space part of the formula, but a brackets closed wrongfully placed...

left([Country Phone Code], length([Country Phone Code])) + " " + right([Mobile corrected], length([Mobile corrected])-length([Country Phone Code]))

Labels