Get Dates to Do What You Want in Tableau (Date Parts vs. Date Values)

By: Eric Parker

Pro Headshot.jpg

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email.

One of Tableau’s greatest strengths is the ability to easily and intuitively visualize historic information. When that data is broken out by date, Tableau can display the data broken out by “Date Part” or “Date Value”. This terminology and concept is unique to Tableau and provides the designer with a lot of flexibility.

It’s easy to misunderstand the differences between these two date visualization methods. Let’s walk through what makes them unique and which scenarios each is best for.

138-1.png


Date Parts

If you left-click and drag a date field into a worksheet the pill will default to Date Part Year. You can see in the worksheet below that the default pill color is blue indicating it is Date Part, not Date Value. When a date field is visualized as Date Part it creates labels (notice 2019 is selectable) instead of a continuous axis.

One of the most distinctive features of Date Parts is that data is aggregated at the selected date unit level. For instance, in my example data set there are thousands of rows of transactions spanning four years, but when I select Date Part Month there are only 12 data points visualized.

 
138-2.png
 

In this case, all January sales (regardless of year) are aggregated and consolidated into a single point.

You can choose between different date units by selecting the drop down on a date field pill and selecting the desired date unit.

On the dropdown:

 
138-3.png
 

In action:

 
138-4.png
 

Date Parts are primarily used in two instances.

Comparative/Overlay Analyses:

138-5.png

Text Tables:

 
138-6.png
 

You can also use the drop-down on a date unit pill to select a Date Value. Date Values are on the bottom of the selection dialogue whereas Date Parts are on the top.

138-7.png

 

Date Values

Date values are primarily used to display chronological progress. They create a continuous axis broken down at the date unit selected. Date Values are green pills by default.

138-8.png

On top of being used to display chronological progress, Date Values are often paired with Forecasts and Trends.

Forecasts:

138-9.png

Trends:

138-10.png

History of Date Types in Tableau

Historically Date Parts were referred to as “Discrete Dates” and Date Values were referred to as “Continuous Dates”. In old Tableau documentation you may still see those terms used. They decided those terms were too confusing and started phasing them out a couple years ago.

To keep it simple, when you hear the terms “Discrete” in Tableau think of “Creates Labels”. When you hear the term “Continuous” think “Creates Axes”.

Technically, you can make Date Values discrete and you can make Date Parts continuous. For instance, observe this graph displaying Sales by Date Value Month.

138-11.png

If I select the drop-down and switch the pill from Continuous to Discrete…

 
138-12.png
 

...the axis changes into labels.

138-13.png

Switching a date pill from Continuous to Discrete or vice versa should only be used in rare circumstances. The majority of the time, that will not be necessary.

This graphic displayed earlier should summarizes the details of the blog post in a succinct fashion.

138-14.png

Looking for help working on your own projects or answers to your own questions? Sign up for an office hour and we can help!

Color a Selected Data Point in Tableau

What is the best college in the United States?

0