How to customize output with groupby and aggregate fields in merge
Overview
In Zoho Writer, when working with merge templates, you can use transform, aggregate functions and grouping to summarize and organize your data—especially useful when dealing with tabular data like invoices, reports, or summaries.
With Groupby and Aggregate Field you can organize and compute data as shown
✴️ Transform Merge Data
You can transform data during a merge to display it in the desired format or structure—without modifying the original source. When your data source (like Zoho CRM or Zoho Creator) provides flat or repeated records—and you want to display them in a nested, grouped format (like a subform or table)—you can transform the data during the merge using Zoho Writer's Data Transformation options.
Group By merge fields are used to group and display repeated records in a structured way, organizes the data into sections based on unique values of that field.
Example use case: Group sales data by Region, so that all sales entries under each region are listed together.
Once grouped, you can apply aggregate functions like:
SUM() – Total values (e.g., total sales)
MAX() – Highest value
MIN() – Lowest value
AVG() – Average value
Prerequisites
- Open a new merge template in Zoho Writer (File --> New Automation Template --> Merge Template --> Create from scratch)
- Go to Automate > Setup Data Source and Fields in the template
Steps
-
-
Click on Transform Data Source as shown below
-
Under Manage Fields and click on Transform to create subform.
c. Grouping by a column results in a grouped subform creation.
-
Click on the transform icon and choose Edit Transformed Data Source or Clear Transformed & Revert.
Note: Clearing the transformed field reverts it to a main field and the inserted transformed fields will now be unmapped.
To Create GroupSets:
- You can group data from field listing using the GroupBy icon as shown below
or using the Group by icon after inserting the data as a repeat block in the template as shown
In the Group by popup , Set the Name of the Group by Field and the Fields to be grouped
To create aggregate fields
Click on Aggregate icon to Aggregate Data of the select fields for a given Group Set or Whole Data as shown in the popup
Related Articles / Videos