Chapter 37. Using Smarter Filtering
The basics of filtering were covered in Chapter 23, but filtering doesn’t have to mean just manual clicking or setting date ranges to specify what data should be included in your output. Calculations, joins, and measuring percentage variance can all make filters smarter and more automated. Removing manual work during the data preparation stage reduces the risk of mistakes and makes it easier to share the data set with others once it is published.
Calculations
Any calculation can be used as a way to trigger filters. However, there are certain types of calculations that are more common than others for use as filters.
Boolean Calculations
Testing whether or not a value in a data field meets a condition—for example, if a value exceeds a logical limit—is a great way to clean data and remove the records that you do not want. In the example shown in Figure 37-1, we know that Percent Complete cannot exceed 100%, so we use a Boolean filter calculation in Prep to ensure the value is 1 or less by removing any values that exceed 1.
Remember, percentages are often set as a value between 0 and 1 rather than 0 and 100, as this helps formatting in Tableau Desktop.
Logical Calculations
IF
and CASE
calculations can contain quite complex logic that makes filtering easier by matching certain scenarios across multiple ...
Get Tableau Prep: Up & Running now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.