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
Solved! Go to Solution.
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!
Hi @DavidOliverChapman this syntax should work i'm assuming your year is a numeric value and not a string ToString([Year])+"."+[Quarter]
@LordNeilLord, @Ladarthur
Thanks guys for the quick response.
I have tried both solutions, and both work really well.
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.
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.