Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to concatenate year and month in tableau 8.0.0?

I have a datetime field .for e.g. 2013-08-22 12:00:00 AM. I want to concatenate the year and month and i want the output as 201308.

When i try year (datetime_field)+month(datetime_field) what i get get is 2013+08=2021 .. i.e it adds instead of conactenating. Can someone pl tell how to get the output as 201308?

like image 353
Gautam Seshadri Avatar asked Dec 16 '22 07:12

Gautam Seshadri


1 Answers

something more like

str(year(datetime_field)) + str(month(datetime_field))

should give you what you want.

the str function converts your numeric data to a string, setting up the + to be a string-concatenation operation instead of an arithmetic-addition operation.

like image 156
Hellion Avatar answered Jan 05 '23 19:01

Hellion