summarize_columns
Creates a summary table based on specified columns and optional filter expressions.
Syntax
summarize_columns(<columns>, <filters>)
| Parameter | Type | Description |
|---|---|---|
| columns | Array | An array of column names to group (dimensions) and summarize (measures). |
| filters | Array | An optional array of filter expressions to refine the result set. |
Return values
Table
Usage
Groups orders by customer ID and calculates the sum of total prices for each customer.
summarize_columns(orders, orders.customer_id, sum(orders.total_price))