--- title: "How to: Find the Mean Value Using the Aggregate Operator" slug: "aggregate-operator-mean-by" updated: 2025-09-25T21:07:13Z published: 2025-09-25T21:07:13Z canonical: "docs.unqork.io/aggregate-operator-mean-by" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.unqork.io/llms.txt > Use this file to discover all available pages before exploring further. # Aggregate Operator: Mean By ## Overview In some instances, you'll use the Data Workflow Aggregate operator to find the average of a set of values. You'll use the Mean By function to do that. For example, let's say you have a Data Table that holds several dogs' ages. You can then create a Data Workflow to find the average age. (Do note, though, that we love all dogs equally at Unqork, regardless of age.) Here's how your module will look in the Module Builder: ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Aggregate_MeanBy_ME.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) Here's how the completed use case will look in Express View, including a peek at the DevTools Console: ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Aggregate_MeanBy_Express.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) ## What You'll Learn In this article, you'll learn how to use the Aggregate operator's Mean By function. ## What You'll Need To set up this use case, you’ll need: - 1 Data Table component - 1 Button component - 1 Data Workflow component To set up your Data Workflow, you'll need: - 1 Input operator - 1 Aggregate operator - 1 Console operator > [!NOTE] > These instructions assume you have a new module open, saved, and with a title. ## Configuration ### Configure the Data Table Component First, you'll add your Data Table. This will hold the data you'll bring into your Data Workflow. Here, you'll set up a list of dogs, storing their name and age. 1. Drag and drop a **Data Table** onto your canvas. 2. Enter dtDogs in the **Label** and **Property Name**. 3. In the data table, enter the following: | A | B | | --- | --- | | name | age | | Ivy | 7 | | Lucy | 10 | | Wally | 1 | | Nacho | 5 | | Thor | 5 | | Holly | 13 | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_Aggregate_MeanBy_DT(1).jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) 4. Click **Save**. ### Configure the Data Workflow Component Next, you'll add your Data Workflow component. You'll bring your data into the Data Workflow using an Input operator. Then, you'll add an Aggregate operator to calculate the average age. Finally, you'll show the result using a Console operator. 1. Drag and drop a **Data Workflow** onto your canvas. Place your Data Workflow below your Data Table. 2. Enter dwfAge in the **Canvas Label Text** and **Property Name**. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Aggregate_MeanBy_Dwf.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) #### Configure the Input Operator 1. Drag and drop an **Input** operator onto your Data Workflow canvas. 2. Configure the **Input** operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input | | Component | dtDogs | | Required | Yes | | Source | Default | #### Configure the Aggregate Operator 1. Drag and drop an **Aggregate** operator onto your Data Workflow canvas. 2. Configure the **Aggregate** operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Aggregate By | | Label | Average Age | | Aggregation Type | Mean By | | Join Group Keys | No | | Group Key | | | Value Key | age | 3. Connect the output port (right) of the **Input** operator to the input port (left) of the **Aggregate** operator. #### Configure the Console Operator 1. Drag and drop a **Console** operator onto your Data Workflow canvas. 2. Configure the **Console** operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Console | | Label | What is the average age? | 3. Connect the output port (right) of the **Aggregate** operator to the input port (left) of the **Console** operator. 4. Click **Save**. ### Configure the Button Component Now, you'll add a Button component to start the operation. Clicking your button fires your Data Workflow. From there, your Data Workflow takes the ages and finds the average. 1. Drag and drop a **Button** component onto your canvas. Place your Button below your Data Workflow. 2. Enter btnAverageAge in the **Property ID**. 3. Enter Find the Average Age in the **Label Text**. 4. Select **Event** from the **Button Action Type**. 5. Enter dwfAge in the **Trigger on Click**. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_Aggregate_MeanBy_Btn.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) 6. Click **Save**. 7. **Save** your module. Now, preview your module in Express View and open the DevTools Console. Next, click your button. You'll see the average age next to the label from your Data Workflow: **What is the average age?** ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_Aggregate_MeanBy_Console.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A47Z&se=2026-11-07T18%3A57%3A47Z&sr=c&sp=r&sig=OVs8uFD9qGDTSSCcpEHYa8zxSjRV7S9a9azEgrU1nH0%3D) ## Lab You can view this complete use case here: [https://training.unqork.io/#/form/5f6a5ea619c4e6024ed1e54d/edit](https://training.unqork.io/#/form/5f6a5ea619c4e6024ed1e54d/edit).