How to use Bases in Obsidian
Master Obsidian's AND/OR filter logic to build complex database queries - learn how nested conditions combine and avoid common mistakes
5 minute read
Understanding Obsidian's Filter Logic: A Guide to Nested Conditions
Introduction
- Obsidian's database views offer powerful filtering, but the nested logic can be confusing
- Understanding AND vs OR logic is crucial for getting the results you want
- This guide will help you visualize how filters combine
Core Concepts
The Two Building Blocks
- 
"Any of the following are true" (OR logic) - Item matches if it satisfies AT LEAST ONE condition
- Think: "this OR that OR the other thing"
 
- 
"All of the following are true" (AND logic) - Item matches ONLY if it satisfies EVERY condition
- Think: "this AND that AND the other thing"
 
How Nesting Works
- Filters can be nested inside other filters
- Each filter group treats its children as a list of options
- Understanding the hierarchy is key
Common Mistakes
Mistake #1: Thinking Nested Groups Apply to Everything Above
What people expect:
Show me items where:
- fileClass is article OR software OR prompt
- AND description is empty
What they actually create:
Show me items where ANY of these are true:
- fileClass is article
- fileClass is software
- fileClass is prompt
- description is empty
The problem: The "description is empty" becomes just another OR option, not a requirement
Mistake #2: Mixing Up Group Types
- Using "Any" when you need "All"
- Not realizing which group your condition is inside
How to Think About Filter Structure
Visual Method: The Indentation Tree
- Each indent level represents nesting
- Conditions at the same indent level are siblings
- Look at what connects them: "or" or the group label
Sentence Method: Read It Aloud
Convert your filter to plain English:
- "Show items where ANY of (A or B or C or D)"
- vs "Show items where ALL of (ANY of (A or B or C) AND D)"
Diagram Method: Using Venn Diagrams
- OR = union of circles (anything in either circle)
- AND = intersection (only the overlap)
Building Filters Step by Step
Example 1: Items with specific fileClass AND empty description
Goal: Find articles, software, or prompts that don't have descriptions yet
Wrong way:
Any of the following:
  - fileClass is article
  - fileClass is software
  - fileClass is prompt
  - description is empty  L (This makes it OR!)
Right way:
All of the following:
  - Any of the following:
      - fileClass is article
      - fileClass is software
      - fileClass is prompt
  - description is empty  
Example 2: Complex filters with multiple requirements
Goal: Show urgent tasks that are either unassigned OR assigned to me
All of the following:
  - priority is high
  - Any of the following:
      - assignee is empty
      - assignee is [your name]
Example 3: Excluding items
Goal: Show all articles except drafts with no date
All of the following:
  - fileClass is article
  - Any of the following:
      - status is not draft
      - date is not empty
Troubleshooting Your Filters
When results don't match expectations:
- 
Write out what you want in plain English - "I want items that are X AND have Y"
- "I want items that are X OR Y but NOT Z"
 
- 
Identify the main connector - Is your goal AND (all conditions must be true)?
- Or is your goal OR (any condition can be true)?
- That determines your outer group type
 
- 
Build from the outside in - Start with your main group type (All/Any)
- Add nested groups for complex sub-conditions
- Test after each addition
 
- 
Check the indentation - Are conditions at the same level siblings?
- Is your condition inside the right parent group?
 
Practical Exercise
Try building these filters yourself:
Exercise 1: Find all books or articles published in 2024 or 2025
Solution
All of the following:
  - Any of the following:
      - fileClass is book
      - fileClass is article
  - Any of the following:
      - year is 2024
      - year is 2025
Exercise 2: Find incomplete tasks that are high priority AND (due today OR overdue)
Solution
All of the following:
  - status is not complete
  - priority is high
  - Any of the following:
      - dueDate is today
      - dueDate is before today
Quick Reference Card
| When you want... | Use this structure | 
|---|---|
| A OR B | Any of: A, B | 
| A AND B | All of: A, B | 
| (A OR B) AND C | All of: (Any of: A, B), C | 
| A OR (B AND C) | Any of: A, (All of: B, C) | 
| NOT A | A is empty / A is not [value] | 
Conclusion
- Filter logic follows boolean algebra (AND/OR)
- Nesting creates hierarchy - understand your structure
- When confused, write it out in plain English first
- Test incrementally to catch mistakes early
For the video version:
- Screen recording showing the exact issue from your screenshots
- Live demonstration building filters step by step
- Side-by-side comparison of wrong vs right filter structure
- Real-time testing showing how results change
- Annotated diagrams overlaid on screen
- Common pitfalls section with examples from real use cases
Build Your Website with AI—No Code Required
Learn to create and deploy professional websites using ChatGPT and Claude. Go from complete beginner to confident website builder.

