Aggregate
aggregateBuild time-windowed aggregation queries by specifying a table, metric column, aggregation function, and optional time column with interval for grouping. No raw SQL needed.
Instructions
Build and run a time-windowed aggregation query without writing raw SQL. Specify a table, metric column, aggregation function, and optional time column with interval for grouping.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to aggregate from. | |
| metric | Yes | Column to aggregate (e.g. 'revenue', 'count'). | |
| func | Yes | Aggregation function. | |
| timeColumn | No | Date/DateTime column to group by time window. Omit for a single aggregate. | |
| interval | No | Time bucketing interval. Required if timeColumn is set. | |
| filter | No | Optional WHERE clause condition (without the WHERE keyword). | |
| groupBy | No | Optional additional column to group by. |