Working with Dates in Tableau can get confusing at the start. Especially when it comes to working out the difference between date parts and date values, (the difference between green date pills and blue date pills). In this blog, I will explain the differences and appropriate use cases for both.
Discrete and Continuous field Distinction
Date fields in Tableau can be both discrete and continuous like any other field.
Just as a refresher, discrete fields (indicated with blue colour) are categorical values. They are finite and are shown as headers in Tableau. From the Sample – Superstore dataset, default ones are fields such as “Customer Name”, “Category” and “Sub-category”.
Continuous fields are indicated with the green colour in the data pane. Unlike discrete fields, continuous fields are not finite but infinite (depending on the range of your data). They are shown in axes instead of headers. Examples of this include “Sales” and “Profit” in the Superstore dataset.
For more information on discrete and continuous fields in Tableau, check out this resource from Tableau.
Date Parts
Date Parts are comprised of discrete date field “parts”. They are discrete date parts by default when they are imported into the view. It is called parts because in a way, that specific date field is separated into parts like years or months. Due to its separation, it aggregates data differently according to its configuration. For example if I only had MONTH(Order Date) and SUM(Sales) in my view with no year filter or year in the view. Tableau would aggregate the sales data of all years and separate them by months. So I would get sales figures for all January, February, March etc… for all years.
However, when we bring in year to the view, now Tableau will dis-aggregate accordingly by first looking into years and then months.
This is the beauty of date parts. They offer the option to drill down in your date field and place them in any order that you would like. Since dates are being broken into categories, personally the best way to view the data in this case is in bar chart form. However, for different purposes, line charts can also be useful as a visualisation on date parts. But in my opinion, they are better to use with date values.
Date Values
As mentioned before, date values exist in an axis and not headers. Date values represent data in a continuous timeline. Therefore it will show change in data from the start to the end of your date field, considering there are no filters on date.
As you try to drill down on date values, you will notice it will not behave the same way as date parts. More pills aren’t added to the shelves but the existing pill changes.
From the video, it can be noticed that the x-axis encapsulates the start and end date always. Only the level of detail is changed.
Examples of Use Cases
Both date parts and values can offer benefits in different aspects of data analytics through Tableau. Since date parts aggregate data according to the selected date unit, they can be more useful in nested analyses scenarios or in text tables. Whereas date values due to their continuous timeline progression, will be more useful for visualising chronological progress, trends and forecasts.
Visit our site The Information Lab NL to see more blog posts, training and consultancy services regarding Tableau, Alteryx and Snowflake.