--- title: "How Do I Create Periods Using the Group By Function?" slug: "how-do-i-create-periods-using-the-group-by-function" description: "This article will explain how to use the Group by and Sum functions to create a report with different time periods in Lasernet FO Connector." updated: 2026-02-05T16:05:45Z published: 2026-02-05T16:05:45Z canonical: "kb.lasernetgroup.com/how-do-i-create-periods-using-the-group-by-function" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # How Do I Create Periods Using the Group By Function? Users may wish for a report to display different time periods. This article will explain how to use the **Group by** and **Sum** functions to create a report with different time periods. The customer period report may look as follows: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-UKY58ZC1.png) Follow these steps: 1. Create a new query report, then click **Setup** > **Query wizard**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-B1XLMZ75.png) 1. Navigate to **Tables**, then add the **CustTable** table and four new queries using the **+** sign. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-5TIZU49N.png) 1. Give the new query a name and set **Group by=Yes** for all four new queries. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-I5X2ZRCH.png) 1. Add **CustTrans** to the new queries. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/1621502558905.png) 1. Under the **Selected fields** tab, remove the **Recid (Group by)** fields from the **CustTrans** tables to avoid getting the data grouped by every transaction/record. 2. Add **AccountNum** and **AmountMST** to all **CustTrans** tables. Set it up as follows: **AccountNum**: Group by This will group the **CustTable** records by **AccountNum**. **AmountMST**: Sum This will calculate the sum of the field **AmountMST** for all records with the same **AccountNum**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-VV1JALW4.png) 1. Navigate to the **Default ranges** page and add the field **TransDate** to all **CustTrans** tables. 2. Define the different time periods by clicking the **Expression editor** button to change the value in the properties for each field to the following: - **CustTrans**: ( today ( ) - 30 ) + ".." + today ( **)** - **CustTrans_1**: ( today ( ) - 60 ) + ".." + today ( ) - **31** - **CustTrans_2**: ( today ( ) - 90 ) + ".." + today ( ) - **61** - **CustTrans_3**: ".." + today ( ) - **91** ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-Y9QIPCTU.png) ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/1621505481659.png) For more information on this topic, read our [Lasernet FO Connector User Guide](/v1/docs/user-guide).