Reputation: 781
I would think this is relatively straight forward but cant find documentation on how to do it(or the correct syntax to use) and my messing around hasn't worked so far.
For Dates we have a custom format called Month /Day /Year. This pulls back a the date(as a date type) in date format as such:
"14 April 2003"
The code behind this is:
(DATEPART('year', [Close Date])*10000 + DATEPART('month', [Close Date])*100 + DATEPART('day', [Close Date]))
What I want to get back is the month is numeric format like:
"14.04.2003"
Is it simply changing the "month" part in the code to a different type? Has any one come across this?
Cheers
Upvotes: 0
Views: 11823
Reputation: 781
Followed your advice and just had to change the date pill, in the column field, to a continuous value. Then right clicked -> format -> Scale -> custom. Then used the above suggested format setting. Thanks Petr, woodhead92.
Upvotes: 0
Reputation: 3317
lampbob, I'd just use date formatting which will mean you will still be able to use all the date-fields flexibility that Tableau provides.
Select Custom format with the following input:
dd.mm.yyyy
See the screen below for more details:
Upvotes: 2
Reputation: 127
This can be easily achieved using the 'Format' option in Tableau. Here are the steps to follow to format the date field as you have specified.
Screenshots: String format for date, Changing to 'DAY' and 'Format...'
Upvotes: 1
Reputation: 11896
If you are only concerned about how the date is presented, then leave the datatype as a date, and use a custom format string via the format pane to display it as desired.
Upvotes: 0