Alteryx Designer Desktop Discussions

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

Adding punctuation in a concatenate formula

DavidOliverChapman
7 - Meteor

Hello. I have a dataset in which there are a "year" [string] and a "quarter" [string] column. 

 

I would like to join the two to create a field such as "2010.Q3".

 

I have tried the following formula, but it returns an error:

 

[Year" + "." + [Quarter]

 

I am sure I am doing something very basic here which is wrong (amateur hour at the ol' Chapman place) but any help would be greatly appreciated.


DoC

5 REPLIES 5
Ladarthure
14 - Magnetar
14 - Magnetar

Hi,

 

few things, check the length of the new field, and to ensure the year is in a string format, you could use a tostring([year]) it should work!

 

Hope it helped!

JosephSerpis
17 - Castor
17 - Castor

Hi @DavidOliverChapman  this syntax should work i'm assuming your year is a numeric value and not a string ToString([Year])+"."+[Quarter]

 

String090819.JPG

LordNeilLord
15 - Aurora

Hey @DavidOliverChapman 

 

Try

 

ToString([Year]) + "." + [Quarter]

DavidOliverChapman
7 - Meteor

@

 

 

 

Re. Year as a number field. I had created the "Year" field from a date column (2010-06-22), using a text to columns function. I had formatted the date field, and the resulting three columns, as "String". Would it be "best practice" to format these as numeric fields?

 

Again - thanks for the quick response. Much appreciated.

 

 

jnans
8 - Asteroid

If your Year was a string as assuming you had typed your formula exactly as you typed it above, I noticed there was a small formatting issue with your initial format.

 

You had typed - [Year" + "." + [Quarter]

 

The formula should have been - [Year] + "." + [Quarter]

 

There was a quotation at the end of year instead of the end bracket. If both fields were string you were close to having the answer you needed.

Labels