Example

{% table_filter
    id="my_filter"
    data="demo_daily_orders"
/%}

Attributes

id
String
required
Unique identifier for the filter component
className
String
Additional CSS classes to apply
data
String
required
ID of the table to filter
defaultConjunction
String
default:"AND"
Default conjunction between filters (AND or OR)
columns
Array
Array of column IDs to filter on. If not provided, all columns are available for filtering
showClearButton
Boolean
default:"true"
Whether to show a clear button to remove all filters
minimumRecords
Number
When set, string filters will only show values that have at least this many records, and filters will always use AND conjunction
width
Number
Set the width of this component (in percent) relative to the page width

Available Filter Properties

When you reference a table filter filter in inline queries using the {{filter_id.property}} syntax, the following property is available:

.filter

Returns a complete SQL filter expression combining all active filter conditions with the specified conjunction (AND/OR). Returns true when no filters are active.

Example Usage

{% table_filter
  id="sales_filter"
  data="sales_data"
  columns=["region", "product_category", "sale_date"]
/%}

```sql filtered_sales
select * from sales_data
where {{sales_filter.filter}}
For more details on using filters in SQL queries, see the Filters documentation.