Filters allow users to interactively control the data displayed in your Intelligent App dashboards. They are linked to variables and can be referenced in SQL queries to dynamically filter results.

Filter Types

Datazone supports several filter types:

TypeDescription
textFree text input
numberNumeric input
dropdownSelect from a list of options
dateDate picker

Filter Configuration

Each filter is defined in the components.filters section of your YAML configuration. Key properties:

  • type: The filter type (text, number, dropdown, date)
  • name: Unique filter name
  • title: Label shown to users
  • affected_variable: The variable(s) this filter updates
  • default_value: (Optional) Default value
  • options: (For dropdown) Static or SQL-driven options
  • placeholder: (Optional) Placeholder text

Example: Static Dropdown Filter

- type: dropdown
  name: membership_type_filter_limited
  title: Membership Type
  affected_variable: membership_type_second
  default_value: 'all'
  options:
    type: static
    values:
      - value: all
        label: All
      - value: basic
        label: Basic
      - value: premium
        label: Premium
      - value: vip
        label: VIP

Example: SQL-Driven Dropdown Filter

- type: dropdown
  name: membership_type_filter
  title: Membership Type
  affected_variable: membership_type
  options:
    type: sql
    query: |
      SELECT distinct ProductGroup_Name FROM PROCESSED_Sales_Order LIMIT 100;

Example: Date and Number Filters

- type: date
  name: order_date_filter
  title: Order Date Filter
  affected_variable: order_date
  default_value: '2024-04-01'

- type: number
  name: penalty_count_filter
  title: Penalty Count Filter
  affected_variable: penalty_count
  default_value: 10
  placeholder: 'Enter penalty count'

Using Filters in Queries

Filters update variables, which you can reference in your chart queries using double curly braces:

query: |
  select * from PROCESSED_Sales_Order WHERE OrderDate > '{{ order_date }}' limit 100;

Best Practices

  • Use descriptive titles and placeholders for better UX
  • Use SQL-driven dropdowns for dynamic option lists
  • Set sensible defaults to improve initial dashboard state
  • Group filters logically on tabs for clarity

See also: Intelligent Apps Overview, Chart Reference