Group a Table

Groups a table by a specified column and optionally aggregates other columns.

Overview

This procedure groups a table by the values in a specific column, and optionally aggregates other columns. This helps you organize and summarize data into meaningful categories. It's useful when you want to analyze totals, averages, or counts within each group, such as total sales by region or number of employees per department.

Prerequisite Data

These required data elements must be present in the automation before using the procedure.

Data Name
Data Type

the table

Table

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

group the table by

What does it do?

Groups the table by the specified column and applies optional aggregation on other columns.

Where does it go?

This phrase should be written on a new line.

Is it required?

✅ Yes — This phrase is required in the syntax.

Does it require input data?

⛔ No — This phrase does not require input data.

the other columns are

What does it do?

Provides an optional list of columns with aggregation functions to apply. Supported aggregation functions are Sum, Average, and Count. To specify aggregation, list the columns in this format: "'s ". For example: "Salary's Sum", "Name's Count", or "Score's Average". If not specified, a count of rows for each group will be returned.

Where does it go?

This phrase should be indented beneath group the table by <thing> with.

Is it required?

🌟 No — This phrase is optional in the syntax.

Does it require input data?

✅ Yes — List of texts

Examples

1. Group by Column with Aggregation

create a table where
    the headers are "Department", "Employee", "Salary"
    the rows are
        "HR", "John Doe", 50000
        "HR", "Jane Doe", 60000
        "IT", "Jim Beam", 70000
group the table by Department with
    the other columns are "Salary's Sum"

2. Group by Column with No Additional Columns

create a table where
    the headers are "Project", "Hours Worked"
    the rows are
        "Project A", 10
        "Project B", 20
        "Project A", 15
group the table by Project

Last updated

Was this helpful?