Back to The Times of Claw

DenchClaw Filters: Advanced Filtering Guide

A complete guide to DenchClaw's filtering system — operators, field types, combining filters, and saving views for instant access.

Mark Rachapoom
Mark Rachapoom
·6 min read
DenchClaw Filters: Advanced Filtering Guide

DenchClaw Filters: Advanced Filtering Guide

DenchClaw's filter system is the engine that powers saved views, natural language queries, and AI-generated perspectives on your CRM data. Understanding how filters work — the operators available, how to combine them, and how they translate to SQL — helps you build powerful views and get more from the natural language interface.

How Filters Work Under the Hood#

Every filter in DenchClaw eventually becomes a SQL WHERE clause applied to a PIVOT view. When you create a saved view with filters, DenchClaw:

  1. Reads the filter configuration from .object.yaml
  2. Translates each filter condition to a SQL predicate
  3. Executes the combined query against the appropriate v_OBJECTNAME PIVOT view
  4. Returns the matching rows to the frontend

The filter YAML and the SQL are in 1:1 correspondence. Understanding the YAML means understanding the SQL.

Filter Structure#

A filter block in .object.yaml looks like this:

filters:
  - field: Status
    operator: equals
    value: Active

Multiple filters default to AND logic:

filters:
  - field: Status
    operator: equals
    value: Active
  - field: City
    operator: equals
    value: "San Francisco"

Translates to:

WHERE "Status" = 'Active'
  AND "City" = 'San Francisco'

All Filter Operators#

Text Operators#

OperatorSQL EquivalentExample
equals= 'value'Status equals "Active"
not_equals!= 'value'Status not equals "Churned"
containsILIKE '%value%'Name contains "Smith"
not_containsNOT ILIKE '%value%'Notes not contains "competitor"
starts_withILIKE 'value%'Email starts with "info@"
ends_withILIKE '%value'Email ends with "@gmail.com"
is_emptyIS NULL OR = ''Phone is empty
is_not_emptyIS NOT NULL AND != ''Email is not empty

Number Operators#

OperatorSQL Equivalent
equals= value
not_equals!= value
greater_than> value
less_than< value
greater_than_or_equal>= value
less_than_or_equal<= value
betweenBETWEEN value1 AND value2
is_emptyIS NULL

Date Operators#

OperatorSQL Equivalent
equals= 'YYYY-MM-DD'
before< 'YYYY-MM-DD'
after> 'YYYY-MM-DD'
betweenBETWEEN date1 AND date2
today= CURRENT_DATE
yesterday= CURRENT_DATE - 1
this_weekBETWEEN date_trunc('week', CURRENT_DATE) AND ...
last_weekPrevious 7-day window
next_weekNext 7-day window
this_monthdate_trunc('month', ...)
last_monthPrevious month
this_quarterdate_trunc('quarter', ...)
this_yeardate_trunc('year', ...)
in_the_pastCURRENT_DATE - INTERVAL 'N days'
in_the_future> CURRENT_DATE
is_emptyIS NULL

Tags Operators#

OperatorBehavior
containsTag array includes this value
contains_allTag array includes all values in list
contains_anyTag array includes at least one value
not_containsTag array does not include this value
is_emptyTag array is empty or null

Boolean Operators#

OperatorBehavior
is_trueValue = true
is_falseValue = false or null

AND / OR Logic#

Simple AND (default)#

All conditions must match — this is the default when you list multiple filter conditions:

filters:
  - field: Status
    operator: equals
    value: Active
  - field: Score
    operator: greater_than
    value: 80

Explicit AND / OR#

For explicit logic control:

filters:
  operator: AND
  conditions:
    - field: Status
      operator: equals
      value: Lead
    - field: City
      operator: equals
      value: "New York"

OR logic:

filters:
  operator: OR
  conditions:
    - field: Priority
      operator: equals
      value: Critical
    - field: Close Date
      operator: before
      value: "2026-04-01"

Nested Logic#

Combine AND and OR for complex filtering:

filters:
  operator: AND
  conditions:
    - field: Status
      operator: not_equals
      value: Churned
    - operator: OR
      conditions:
        - field: Priority
          operator: equals
          value: High
        - field: Score
          operator: greater_than
          value: 90

This finds entries where Status is not Churned AND (Priority is High OR Score > 90).

Dynamic Filters (Relative Dates)#

One of the most powerful filter features: relative date operators always resolve to current date. A view with Close Date is this_month will show different deals in October vs. November — the filter is live, not static.

This means your saved view "Closing This Month" is genuinely useful every month without manual updates.

Filters in Natural Language#

You don't have to write YAML to set filters. Ask DenchClaw:

"Show me all active deals with a close date this quarter and deal value over $10,000."

DenchClaw generates the filter configuration, applies it, and returns results. If you then say "save this view as 'High Value Q1'," DenchClaw writes the filter to your .object.yaml.

The natural language filter capability means you can explore your data with plain English and only formalize filters into saved views when you find ones worth keeping.

Combining Filters with Sort and Columns#

Filters are more powerful when combined with sort order and visible column selection:

views:
  - name: Stale Deals
    filters:
      - field: Status
        operator: not_equals
        value: Closed Won
      - field: Status
        operator: not_equals
        value: Closed Lost
      - field: Last Activity
        operator: in_the_past
        value: 14 days
    sort:
      field: Last Activity
      direction: asc    # Stalest first
    columns:
      - Deal Name
      - Company
      - Stage
      - Last Activity
      - Owner

See also: DenchClaw Saved Views for saving and managing filter configurations, and Natural Language Queries for filter-as-conversation.

Frequently Asked Questions#

Can I filter by a field that's not shown in the current view columns?#

Yes. Filters operate on the data independently of which columns are visible. You can filter by "Last Contacted" even if that column isn't shown in the table view.

How do I filter for NULL values?#

Use the is_empty operator. For date fields, this finds entries where the date field was never set. For text fields, it finds entries where the field is NULL or an empty string.

Can filters reference values from other objects (cross-object filters)?#

Cross-object filters (e.g., "show deals where the linked company has more than 100 employees") require a subquery. You can ask DenchClaw in natural language and it will construct the appropriate join query, though saving these as YAML views requires custom SQL which DenchClaw can also generate.

Is there a limit to how many filters I can combine?#

No practical limit. Complex nested filters translate to complex SQL, but DuckDB handles them efficiently. For extremely complex filter trees, consider whether a saved view or a custom report query might be cleaner.

How do I filter by tags (multi-select field)?#

Use the contains operator for single-tag matching: Tags contains "Enterprise". Use contains_all to require multiple tags: Tags contains_all ["Enterprise", "Q4 Target"]. Use contains_any for OR matching across tags.

Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →

Mark Rachapoom

Written by

Mark Rachapoom

Building the future of AI CRM software.

Continue reading

DENCH

© 2026 DenchHQ · San Francisco, CA