One of the very important aspects of data science is the visualization of data. I have been working on Tableau for some time now. This has been a journey that has helped to unlock the potential of raw data for it to tell a story. In this process, I have discovered some tips which I have found very useful. In this series of notes, I plan to share this with all. This will serve two purposes — a) as my own reference; b) and as a reference for all those interested.
Use Selectable Time Metric
Allowing a user to select a time metric (month, quarter, year) gives a very powerful option to enable to see the trend embedded in the time series quickly, and flexibly. This is important as the short-term monthly trend might not allow us to see the full picture. Hence, zooming out and viewing the granularity at the quarterly or yearly might be quite useful. To enable this flexibility one needs to follow these steps.
Step1 — Defining a Parameter (Time Metric)
The picture below is a screenshot of the process that one needs to follow while defining the parameter.
Step 2 — Create Custom Dates
The process is captured in the following figure.
You need custom dates for the month, quarter, and year. The custom date is nothing but the following formula = DATETRUNC(“month”,[Order Date]). Similarly use it to define, “quarter” and “year”.
Step3 — Create a Calculating Field (Time Frame)
The process is captured in the following figure.
Step4 — Use Calculated Time Frame as the Dimension
The process is captured in the following figure.
Now the granularity of the view will change as you select a particular time metric from the drop-down menu on the right.
Hope you found this useful. Thanks. More tips to follow.