Why can't I combine AND and OR filters?
Currently, our filtration system doesn't support using AND and OR filters at the same time, because there is no clear way to discern the intended order of operations without parentheses.
For example, suppose you're planning a dinner party, and you have an attendance list in Airtable.
Suppose you applied the following filters:
- Where {Dietary Restrictions} is Vegan
- OR {Dietary Restrictions} is Vegetarian
- AND {Status} is Attending
In this case, it's unclear whether you want to see:
- (Vegans OR Vegetarians) AND Attending
- Vegans OR (Vegetarians AND Attending)
These have different meanings—in the second, vegans who were not planning on attending your party would show up in the filter.
Solution: Create a formula field
To get around this problem, you will need to create a formula field. You can create an IF formula using AND and OR such that the order of operations will be defined exactly how you want it to be, and then you can filter by the results of that field.
So, for example, suppose you want to see a list including both the vegans who are attending and the vegetarians who are attending.
Write a formula which will return "true" if a record fits these criteria:
IF(AND({Attending?} = 1, OR({Dietary Restrictions} = "Vegan", {Dietary Restrictions} = "Vegetarian")), "true")
Then, filter by the new field to get the desired results.