Skip to main content
{% repeat 
	id="category_repeat" 
	data="demo_daily_orders" 
	column="category" 
%}
   {% line_chart
        data="demo_daily_orders"
        x="date"
        date_grain="month"
        y="sum(total_sales)"
        filters=["category_repeat"]
   /%}
{% /repeat %}

Examples

With WHERE Clause

{% repeat 
	id="top_categories" 
	data="demo_daily_orders" 
	column="category"
	where="total_sales > 1000"
%}
   <h3>{{top_categories}}</h3>
   {% line_chart
        data="demo_daily_orders"
        x="date"
        y="sum(total_sales)"
        filters=["top_categories"]
   /%}
{% /repeat %}

Attributes

id
String
required
The id of this repeat component to be used in the filters prop of its children
data
String
required
The name of the table to query
column
String
required
The name of the column within the data table to get distinct values
where
String
SQL WHERE clause to filter which values to repeat over
filters
Array
default:"[]"
Array of filter IDs to apply when querying for distinct values