Step 3: Configure the Pivot Table

Click the Pivot Table tab (next to Data Source, Output, Tabulator, Chart).

In the Groovy configuration editor, enter this:

pivotTable {
  rows 'customer_country'          // row labels — one row per country
  cols 'year'                       // column headers — one column per year
  vals 'net_revenue'                // the numeric value to aggregate
  aggregatorName 'Sum'              // how to combine values (Sum, Count, Average...)
  rendererName 'Table'              // display as a table (or Heatmap, Bar Chart...)
  rowOrder 'key_a_to_z'             // sort countries alphabetically
  colOrder 'key_a_to_z'             // sort years in order
  tableName 'vw_sales_detail'       // the DuckDB view to query
  hiddenAttributes 'sales_key'     // hide internal ID from the UI
  hiddenFromAggregators 'sales_key', 'customer_country', 'customer_name',
    'continent', 'category_name', 'product_name', 'employee_name',
    'month_name', 'year_quarter', 'quarter'
}

What Each Line Does

Key concept: Unlike SQL-based reports where you write a query, DuckDB pivot tables read directly from tableName. The pivot engine handles all the aggregation internally.
Paste this configuration and save. Then click Preview to see your pivot table!