Skip to main content
{% table data="demo_daily_orders" %}
    {% dimension value="category" /%}
    {% pivot value="date" date_grain="year" /%}
    {% measure value="sum(total_sales)" fmt="usd1m" /%}
{% /table %}

Examples

Pivoted Table

{% table data="demo_daily_orders" %}
    {% dimension value="category" /%}
    {% pivot value="date" date_grain="year" /%}
    {% measure value="sum(total_sales)" fmt="usd1m" /%}
{% /table %}

Attributes

value
string
required
fmt
string
date_grain
string
Time grain for date truncation (default: day for date columns)Allowed values:
  • day
  • week
  • month
  • quarter
  • year
  • hour
  • day of week
  • day of month
  • day of year
  • week of year
  • month of year
  • quarter of year
sort
string
Sort direction for this pivot column. When specified, the table will be sorted by this column.Allowed values:
  • asc
  • desc

Allowed Parents