Skip to main content
{% progress_bars
  data="staff"
  dimension="provider_type"
  numerator="count(*) FILTER (WHERE on_shift = true)"
  denominator="count(*)"
  title="Provider Staffing"
/%}

Examples

Basic Usage

{% progress_bars
  data="staff"
  dimension="provider_type"
  numerator="count(*) FILTER (WHERE on_shift = true)"
  denominator="count(*)"
  title="Provider Staffing"
/%}

Attributes

data
string
required
Table or view to query
dimension
string
required
Column for row labels (e.g., provider_type)
numerator
string
required
SQL aggregation for the filled portion (e.g., count(*) FILTER (WHERE active))
denominator
string
required
SQL aggregation for the total (e.g., count(*))
fmt
string
Format code for numerator and denominator values. See Value Formatting for available formats.
title
string
Component title
colors
array
Two-color array defining the gradient for bars and badges, e.g. [“#ef4444”, “#22c55e”]. First color maps to 0%, second to 100%.
thresholds
array
Two percentage thresholds (0-1) creating 3 color zones: red below first, amber between, green above second. e.g. [0.5, 0.8].
lower_is_better
boolean
If true, low percentages are green and high percentages are red. Default (false) means high percentages are green. Only applies when thresholds are set.
filters
array
IDs of filters to apply to the query
where
string
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
having
string
Custom SQL HAVING condition to apply to the query after GROUP BY
limit
number
Maximum number of rows to return from the query. Note: When used with tables, limit will disable subtotals to prevent incomplete subtotal rows.
order
string
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
qualify
string
Custom SQL QUALIFY condition to filter windowed results
width
number
Set the width of this component (in percent) relative to the page width