Query Builder > Aggregate

Learn how to group and summarize SQL data in Draxlr's Query Builder with Group By, date and time intervals, and functions like count, sum, average, min, and max.

Draxlr’s Aggregate feature lets you summarize and analyze your data using SQL-style Group By and aggregate functions—all without writing code.

Use it to count, sum, average, and perform other calculations over groups of data directly in your Explore workflow.

How to Use the Aggregate Feature?

  1. Open the Aggregate Dialog

    • Click Aggregate in the left panel, under Start your query or in the toolbar below your query steps.
    • The Aggregate your data dialog opens.
  2. Set Up Group By Rules

    • In the Group By section, choose:
      • Table: Select the relevant table (e.g., Orders).
      • Field: Choose the field you want to group by (e.g., EmployeeID).
      • Interval: For date and time fields, pick how to group them (e.g., group OrderDate by Month):
        • Date: Year, Month, Month Name, Week, Date or Day.
        • Date-Time: the date options, plus Date and Time, Hour, Minute or Second.
        • Time: Time, Hour, Minute or Second.
    • Click + Add More to add more grouping fields.
    • Remove a group with the – button.
  3. Add Aggregate Functions

    • In the Functions section, define what you want to calculate for each group:
      • Count of rows: Total number of rows in each group.
      • Count of ...: Number of non-null values in a column.
      • Distinct count of ...: Number of unique values in a column.
      • Min of ... / Max of ...: Minimum or maximum value in a column.
      • Avg of ...: Average value in a column.
      • Sum of ...: Total sum of values in a column.
    • For each function, select the operation, then the table and field (not needed for Count of rows).
    • Add more functions with + Add More. Remove any with the – button.
  4. Run the Aggregation

    • Once your Group By and Functions are set, click Execute.
    • Your table will update, showing results for each group and the computed values.

Tips

  • Multiple Groupings: Combine several fields for advanced breakdowns.
  • Date Intervals: Summarize data by year, month, week, day, and more.
  • Flexible Functions: Mix and match count, sum, average, min, max, and distinct counts.
  • Totals only: Leave Group By empty to get a single total for the whole table.