Mar
20
Filtering Partial Date Period in Tableau
For the sake of uniformity in a bar chart, we may need to filter out dates in the latest partial week, month, quarter or year. That is what Parinita asked me about a filter to do just that.
How to design a filter for it? Especially, we need the design to take into consideration of dynamic date range which can be changed by the user.
Here we will show two approaches to it. They differentiate themselves by the order of filtering. Note that we will use a parameter Date Grain to denote the selected date period. A grain can be any of day, week, month, quarter and year. We will use the superstore data set to create examples.
1. LOD Approach
This is a pre filter approach. It will remove the data rows in the partial period before calculations.
How to design a filter for it? Especially, we need the design to take into consideration of dynamic date range which can be changed by the user.
Here we will show two approaches to it. They differentiate themselves by the order of filtering. Note that we will use a parameter Date Grain to denote the selected date period. A grain can be any of day, week, month, quarter and year. We will use the superstore data set to create examples.
1. LOD Approach
This is a pre filter approach. It will remove the data rows in the partial period before calculations.