Filters
How to use filters for interactivity in Datazone Intelligent Apps.
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:
Type | Description |
---|---|
text | Free text input |
number | Numeric input |
dropdown | Select from a list of options |
date | Date 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 nametitle
: Label shown to usersaffected_variable
: The variable this filter updatesdefault_value
: (Optional) Default valueoptions
: (For dropdown) Static or SQL-driven optionsplaceholder
: (Optional) Placeholder text
Example: Static Dropdown Filter
Example: SQL-Driven Dropdown Filter
Example: Date and Number Filters
Using Filters in Queries
Filters update variables, which you can reference in your chart queries using double curly braces:
Filter Dependencies
Filters can depend on other filters to create cascading filter effects. When one filter changes, dependent filters can update their options based on the selected value. This is particularly useful for hierarchical data like country/city relationships.
Example: Country and City Filters
In this example, the city filter’s options are limited based on the selected country:
Key Points for Filter Dependencies
- Use conditional logic with
{% if variable_name is defined %}
to check if a filter value exists - Always include a fallback condition (like
WHERE 1=1
) to ensure valid SQL when no filters are applied - Dependent filters will automatically refresh when their parent filter changes
- You can chain multiple levels of dependencies (e.g., country → state → city)
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