How to change date level in Tableau using a parameter – Skill Pill Video

Change date level using a parameter in Tableau btProvider

As Tableau users, we are always looking for ways to improve our views and dashboards. Whether we are talking about using features or improving the overall visual experience, we are always looking for new ways to easily navigate and explore our data. To design an interactive experience when the end user is looking for valuable information from an analysis, Tableau provides many features. In today’s post we will discuss how we can change date level using a parameter.

Probably one of the most used dimensions in a Tableau analysis refers to a date or a time period. Regardless of the information we want to analyze, it is always correlated with a certain period. Otherwise, how could we observe the evolution over time of our results, certain behaviors, or patterns? We chose to address this topic today, regarding how to change date level using a parameter, because it is a great method that gives more control to end users. Finally, it helps them navigate easier and have an interactive experience when exploring data.

How to change date level using a parameter in Tableau Software

Before watching the video below and following all the steps you need to go through to change date level more easily, we want to tell you why we recommend this option. First, in any sales analysis, for example, time period plays an essential role. We cannot analyze sales or profit values without referring to a certain period. And even if we do this, one of our goals is to follow our organization evolution and to better understand the future actions that should be taken.

Thus, we need a dynamic method by which we can change date level. From years to months, from months to weeks or from weeks to days. We need a quick method that allows us to change date level depending on the level of data we want to analyze. The ability to create a parameter in Tableau that allows us to change date level is one of the most dynamic options to compare performance at level of weeks, days, months, etc. Second, it offers more flexibility to end user in terms of date granularity and the time on which it will explore his data.

Last but not least, changing date level using a parameter also offers a more user-friendly experience, being a quick way to change data and information we need. In the video below you will see how you can add a parameter in Tableau to change date level.

Step 1: Connect to data

→ In Tableau Desktop, connect to EU Superstore sample provided by  Tableau.

Step 2: Create the visualization

→ Create a new Parameter having the date type String

→ Select List and add values Day, Month, Year

→Create a new Calculated Field and write the following formula

CASE [Date level]
when ‘Day’ then DATETRUNC(‘day’,[Order Date])
when ‘Month’ then DATETRUNC(‘month’,[Order Date])
when ‘Year’ then DATETRUNC(‘year’,[Order Date])
end

→ Bring the new field to columns, right click on it and select Exact Date

→ Bring Category and Sales to rows

→ Right click on the newly created parameter and select Show Parameter

→ Select the date level desired

By Andrei Stan

Download Tableau Software