Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Concatenate two integer fields into one

mjtowne
8 - Asteroid

Hi,

 

I am trying to concatenate two integer fileds into a string but cant using the formula tool.

 

Example

Field A contains (13) and Field B contains (20) 

 

I am trying to concat to show a new field with (13_20)

 

When trying to use the + sign i get the error type missmatch

 

thanks

 

Martin

8 REPLIES 8
MarqueeCrew
20 - Arcturus
20 - Arcturus

ToString([Field_A]) + '_' + ToString([Field_B]) should work for you.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
mjtowne
8 - Asteroid

I still get the below error

 

[MODULAR_DEPT_NBR] + '_' + [MODULAR_CATG_NBR] + '_' + [MOD_END_SECT_NBR]

 

Type mismatch in operator +

MarqueeCrew
20 - Arcturus
20 - Arcturus

Have you defined your new variable as VSTRING? it might be a numeric DOUBLE by default.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MarqueeCrew
20 - Arcturus
20 - Arcturus

ToString([MODULAR_DEPT_NBR]) + '_' + ToString([MODULAR_CATG_NBR]) + '_' + ToString([MOD_END_SECT_NBR])

 

was the answer....

 

Smiley Happy

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Harsha
6 - Meteoroid

Hi Martin,

 

Please find the attached flow.

what i did is first i have converted the Field A and Filed B data type into sting from byte and written the formula to concate.

 

Thanks,

Harsha.

mjtowne
8 - Asteroid

Hi Harsha,

 

Your solution doesnt work and was the reason i was getting an error. the correct solution is to add the "ToString"(Field) 

Tooluser
5 - Atom

This was a simple fix to my "just concatenate the two number fields" issue. My Access database queries uses a two number field with a dash between to select accounts (number) that have multiple letters (also numbered) sent to the same customer. When the concatenated numbers show up more than once then two or more communications have been sent. 

 

Thanks again.

CEO
6 - Meteoroid

Hello, I am creating a table and I would want two particular fields to concatenate to form a 3rd field. Take for instance: 


class int not null,
studentNo int unique IDENTITY(100000,1) Primary Key,
StudentCode...


Class field will be 3-digits integer.

StudentNo will be automatically generated, starting from 10,000

StudentCode (I want it to contain the class 3-digits for each student and also the studentNo. It will start with the 3-digits of the class. i.e to concatenate the class value and the studentNo value)

I try as much to explain because I want explicit suggestion.

If you are proficient with database (MySql or Microsoft Sql), and you know about this, then kindly help.

Please help with a line or lines of codes.

Labels