Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Concatenate String Data Error

grsomer
8 - Asteroid

Hi, 

 

I am trying to concatenate 5 fields of string data into one in a new column. I am using the formula: [Business Unit (K)]+[Currency (K)]+[Security Group Cd (K)]+[Resident Code (K)]+[Data] . However, I am receiving the error: "The formula resulted in string but the field is numeric."  I would like my data to be output as String data. Is there a way to change this/something wrong with my formula?

 

Thanks!!

6 REPLIES 6
Thableaus
17 - Castor
17 - Castor

Hi @grsomer 

 

Two questions:

 

1) Are all of your fields strings? If not, you need to use ToString function to convert them into strings in your formula

2) Is your new column set as a String type? You can check that below your expression box in the Formula Tool, there's a "Data type" section.

 

Cheers,

darryl5280
10 - Fireball

You are getting the error because of your fields is not a String and the Formula Tool doesn’t automatically convert field types.

 

You can place a ToString() function around the non-string field.

 

You can see the field types on the Result Window on the Input Connection for the Formula, after clicking on the button labeled “MetaData”

grsomer
8 - Asteroid

Hi @Thableaus, thanks for the quick reply!

All of my data is already string and the box to change the data type in the formula tool is greyed out and won't let me change the data from Double. 

grsomer
8 - Asteroid

Hi @darryl5280 , all of my data being used in the formula is already string, and the ToString formula has not worked for me. 

Thableaus
17 - Castor
17 - Castor

@grsomer 

 

The problem is with your new column. Actually you're updating an existing column that is a Double Type already.

 

To change types you could use a Multi-Field formula. You can actually change the type of your existing column right there.

 

Or, you could use a Select Tool and change your column to String before using it in the Formula Tool.

 

Cheers,

darryl5280
10 - Fireball

You have to Create a new field, and then in "Select" after the Formula Tool, to swap the new field name with the old field name.

Labels