5 Replies Latest reply on Feb 19, 2013 8:36 PM by Alex Kerin

# How to use date (year) in Tableau

Hi,

I'm new to Tableau, and I'm trying to make a time series graph of hockey players statistics over a 5 year period. I have a column with heading "Year" and then it has below it 1999, 2000, 2001, 2002, 2003 for each of the players. When I connect to the data in Tableau, it automatically is not using the it as a year, and when I change the data type to Date, it changes it to the year 1905? Strange. Sorry I'm very new, easy question, i'm sure.

Regards,

Nick

• ###### 1. Re: How to use date (year) in Tableau

1999 = 6/21/1905... by the way.

• ###### 2. Re: How to use date (year) in Tableau

A real date is fully qualified - e.g. 1/4/1989. Most (all?) programming languages and operating systems represent dates as a number of days past an epoch date. For MS Excel for example, that epoch date (day 0) is 12/31/1899. The 1st of January 1900 is day 1, 2nd is day two, and so on up to present day (41,324). Dates are represented as decimals - 0.5 for example is midday.

So by changing your year to a date, you are getting 2000 days past the epoch (i.e. somewhere in 1905)

You could leave the year as a number. If for some reason you wanted to have it as a real date, you would need to convert it by creating a calculation something like:

date("1/1/"+str([year]))

1 of 1 people found this helpful
• ###### 3. Re: How to use date (year) in Tableau

Hello Alex, thanks for your response,

As I said, i'm new to Tableau. What I'm attempting to do is make a line graph that shows player performance over time, specifically by year 1999,2000,2001, etc. So, I don't have days or months for the entire season as it wouldn't really make sense to include a random day from the season. A different thread that I found suggested changing the data type in Excel to "text" which DID allow Tableau to read it correctly, however it was not changed to a Date type within Tableau automatically. When I did so, it created the new column, but all the values were null. Any ideas?

Nick

• ###### 4. Re: How to use date (year) in Tableau

Hey Alex!

Sorry to bombard you with stuff. I think I found a workaround (that I believe you initially suggested, but to a newbie it's sometimes unclear until you try it.)

• ###### 5. Re: How to use date (year) in Tableau

You don't need it as a real date - you can have it as a discrete pill (blue) and change the default mark from bars to lines, or you could have it as a green pill (continuous) if you have missing years. You can right click the pill to change these.