(Now with video – video uses different data as an example)
One of my favorite uses of parameters is to dynamically change date aggregations without the pesky drill symbol. Sometimes I want to just see week or month, quarters tend to be pretty worthless. Especially if I’m doing something discrete, I really don’t like the way Tableau breaks apart the data view.
The creation of the parameter leaves me with a very clean user experience and ensures users don’t negatively interact with the viz.
Here’s the setup – first create a parameter of data type string and type in your allowed values. Mine is going to have week and month:
(note I changed the casing on the words later on for look/feel)
Next create custom dates based on your primary date field. Mine is called “Start”:
Right click on the field, go to Create -> Custom date…
For the sake of this viz, I made both a Months and Weeks (both are date value). At one point I had days (shown as “Exact”, but I abandoned it)
Last step is create the calculated field. Right click on the parameter at the bottom, create calculated field:
Place it on your designated shelf. You may have to do some wrangling on the field to get it to display right. For the viz I ended up with, the field is set to “Exact Date” and “Discrete.”
Check out the final experience below: