In Part 1 we set the context for what it means to filter data:
- A filter is established
- Each data point is pushed through the filter, which outputs "True" or "False"
- All data points that resulted in a "False" output are hidden
Here, we'll introduce the context for using multiple filters at one time. For example, let's pretend you're working with the following dataset:
Age: 10, 12, 25, 30, 60
A question you could ask about this dataset (which would ultimately be answered by use of multiple filters) would be:
How many ages are equal to 10, or greater than 40?
Behind the scenes, when you apply a filter to a dataset each value is checked against your rule. In our example, the following would occur:
10 = 10 OR 10 > 40 True
12 = 10 OR 12 > 40 False
25 = 10 OR 25 > 40 False
30 = 10 OR 30 > 40 False
60 = 10 OR 60 > 40 True
Everything that outputs "False" is removed, leaving you with two results (and the answer to our question).
In order to instrument multiple filters you'll use, what we refer to as Connection Operators:
Operator | Filter Condition |
AND | Filter for rows of data that meet all filter criteria (i.e. zero tolerance) |
OR | Filter for rows of data that meet at least one filter criteria |
In our question above (How many ages are equal to 10, or greater than 40?), we leveraged the OR operator. Here's an example question for using AND:
How many ages are greater than or equal to 10, and less than 40?
10 >= 10 AND 10 < 40 True
12 >= 10 AND 12 < 40 True
25 >= 10 AND 25 < 40 True
30 >= 10 AND 30 < 40 True
60 >= 10 AND 60 < 40 False