How filters work
Filters are dashboard-level controls that automatically add variables to your chart queries. When you reference entities or time periods in your prompts, Basedash intelligently creates the appropriate filters and injects them into your SQL queries.Automatic filter creation
Basedash automatically creates filters when you use certain language patterns in your prompts:- Entity references: “Show me details for a user” → Creates a user selector
- Time references: “Revenue over time” → Creates date range filters
- Aggregation references: “Group by category” → Creates grouping options
Filter types
Basedash supports multiple variable types you can use to create dynamic, interactive dashboards. Each type serves a specific purpose and provides different functionality.Record filters
Record filters allow you to select specific records from your database tables. They’re perfect for entity-level dashboards where you want to focus on individual records. Features:- Dropdown selection from database records
- Automatic population from your data source
- Support for multiple values (optional)
- Required/optional configuration
- User profile dashboards
- Order detail pages
- Customer account views
- Product detail pages
Text filters
Text filters provide free-form text input for string-based filtering and search functionality. Features:- Free text input
- String matching and search
- Case-sensitive and case-insensitive options
- Support for partial matches
- Name searches
- Email filtering
- Description searches
- Custom text-based filtering
Number filters
Number filters handle numeric input for quantitative filtering and calculations. Features:- Numeric input validation
- Range selection (min/max values)
- Mathematical operations
- Precision control
- Revenue thresholds
- Age ranges
- Price filtering
- Quantity limits
Boolean filters
Boolean filters provide true/false or yes/no selection options for binary filtering. Features:- Toggle or checkbox interface
- True/false selection
- Default value configuration
- Simple binary logic
- Active/inactive status
- Feature flags
- Subscription status
- Binary classifications
List filters
List filters provide predefined selection options from a curated list of values. Features:- Dropdown with predefined options
- Single or multiple selection
- Custom option lists
- Static value management
- Category selection
- Region filtering
- Status selection
- Department filtering
SQL filters
SQL filters allow you to create custom SQL-based filtering logic for complex queries. Features:- Custom SQL query input
- Advanced filtering logic
- Dynamic query generation
- Complex conditional logic
- Custom business logic
- Complex filtering requirements
- Dynamic query conditions
- Advanced data manipulation
Built-in filters
Basedash provides built-in time controls when your SQL uses the time variables. These appear at the dashboard level and apply across charts that reference them:- Date range: Predefined ranges such as
LAST_30_DAYS
,THIS_MONTH
, or a custom range - Time interval: Aggregation interval such as
DAY
,WEEK
,MONTH
,YEAR
Filter configuration options
Multiple values
Enable “Allow multiple values” to let users select multiple options from list and record filters.Required filters
Mark filters as “Required” to ensure they always have a value before queries execute.Public dashboard visibility
Control whether filters appear on public dashboards with the “Show on public dashboard” option.Default values
Set default values for filters to provide starting points for user interactions.Automatic filter creation
Basedash automatically creates appropriate filter types when you use certain language patterns in your prompts:- Entity references: “Show me details for a user” → Creates a record filter
- Time references: “Revenue over time” → Creates date range filters
- Text searches: “Customers named John” → Creates text filters
- Numeric thresholds: “Orders over $100” → Creates number filters
- Boolean conditions: “Only active users” → Creates boolean filters
- Category selections: “Sales by region” → Creates list filters
Using filters with chart types
Line charts
- Time filters: Automatically adds date range selection
- Record filters: Can add user selection for specific user trends
- Number filters: Can filter by thresholds (e.g., users with >10 logins)
Bar charts
- Record filters: Can add company selection for detailed views
- List filters: Can filter by industry, region, or other categories
- Boolean filters: Can show only active/inactive companies
Funnel charts
- Time filters: Controls the time period for funnel analysis
- Record filters: Can focus on specific user segments
- Boolean filters: Can filter by user status or conditions
Activity charts
- Time filters: Controls the date range for the heatmap
- Record filters: Can show activity for specific users
- Number filters: Can filter by activity thresholds
Map visualizations
- Time filters: Controls the time period for geographic data
- List filters: Can filter by specific countries or regions
- Text filters: Can search for specific locations
Detail views
- Record filters: Essential for selecting which user to display
- Time filters: Can control related time-based metrics
- Boolean filters: Can filter by user status or conditions
Tables
- Record filters: Can add customer selection
- Time filters: Controls the time period for customer data
- Text filters: Can search for specific customer names or emails
- Number filters: Can filter by customer value or metrics
Number displays
- Time filters: Controls the time period for revenue calculation
- Record filters: Can show revenue for specific customers or segments
- Number filters: Can set minimum/maximum revenue thresholds
- Boolean filters: Can filter by active/inactive customers
Best practices
Use open-ended language
Instead of specific time periods, use open-ended language to leverage filters: Good:Reference other charts
Since Basedash AI understands your entire dashboard, you can reference other charts:Leverage entity context
For entity-level dashboards, use entity-specific language:Accessing and managing filters
Variables tab in code editor
You can view and manage all variables for a dashboard by going to the Variables tab within the full-screen code editor. This shows variables with their current values and allows you to modify configurations.Filter highlighting
When you hover over a filter on a dashboard, charts that use that filter will be highlighted, making it easy to see which charts are affected by each filter.Applying filters to other charts
To apply an existing filter to another chart, simply tell the AI to update the chart to use the filter. For example:Advanced features
Cross-chart filtering
Variables can affect multiple charts on the same dashboard, creating cohesive analysis experiences.Dynamic variables
Variables can be used in calculated columns and external links:Filter dependencies
Filters can be linked together, where one filter’s selection affects the options available in another.Related features
- Embedding charts - Embed filtered charts in external applications
- Dashboards - Organize charts with shared filters
- Custom context - Add business context to improve AI understanding
- URL parameters: On internal dashboards, variables use the
var_
prefix. On public dashboards (shared links), variables use theevar_
prefix and are URL-encoded. System parameters includedateRange
,groupByInterval
,customDateFrom
, andcustomDateTo
.