Interactive Board Example¶
A board with variables and filters that update charts dynamically, built on the Dundersign demo dataset; paste it into the playground and it renders as-is.
Complete Board¶
title: "Document Activity with Filters"
source: db
variables:
status:
input: select
options:
static: ["sent", "completed"]
# No default: starts on All statuses
date_range:
input: daterange
# No default: starts on the full history
min_pages:
input: slider
min: 1
max: 20
step: 1
default: 1
queries:
filtered_documents:
sql: |
SELECT
status,
COUNT(*) AS documents,
ROUND(AVG(page_count), 1) AS avg_pages,
ROUND(AVG(days_to_complete), 1) AS avg_days_to_complete
FROM dundersign.documents
WHERE {{ filter('status', status) }}
AND {{ filter_date_range('created_at', date_range) }}
AND {{ filter('page_count', min_pages, '>=') }}
GROUP BY status
ORDER BY documents DESC
monthly:
sql: |
SELECT month, revenue, active_users
FROM dundersign_serving.monthly_metrics
WHERE {{ filter_date_range('month', date_range) }}
AND month > (SELECT MIN(month) FROM dundersign_serving.monthly_metrics)
AND month < (SELECT MAX(month) FROM dundersign_serving.monthly_metrics)
ORDER BY month
rows:
- title: "Filtered Document View"
grid:
columns: 24
items:
- item: documents_chart
width: 12
- item: revenue_chart
width: 12
- item: documents_table
width: 24
charts:
documents_chart:
title: "Documents by Status"
query: queries.filtered_documents
type: bar
x: status
y: documents
revenue_chart:
title: "Revenue by Month"
query: queries.monthly
type: line
x: month
y: revenue
documents_table:
title: "Status Details"
query: queries.filtered_documents
type: table