--- title: "How do I filter, group and total results?" slug: "how-do-i-filter-group-and-total-results" updated: 2026-11-24T13:59:14Z published: 2026-11-24T13:59:14Z canonical: "support.lusid.com/how-do-i-filter-group-and-total-results" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # How do I filter, group and total results? A query often returns more rows than you can take in at once. In the Luminesce Query Editor's results grid you can narrow them down, group them into a tree with a total for each group, and add totals under the whole result. All of this is worked out by Luminesce over every row, however large the result, not only the rows on your screen. ## Prerequisites - Access to the Luminesce Query Editor in the LUSID web app, under **Data Virtualisation > Query Editor**. - A query that has run, with its results showing under the editor. ## Methods ### Method 1: Filter and sort the rows Under each column heading is a filter box. 1. Type in the box to keep only the rows that match. 2. For more choices, select the filter icon beside the box. You can choose how to compare, for example **Not contains**, **Starts with**, **Greater than or equals** or **In range**, depending on the column's type. Filters apply to every row of the result, and the row count beside **Results** changes to match. To sort, select a column's heading. To see every filter at once, select **Filters** in the toolbar above the grid. A number on the icon shows how many filters are in use. Select **Clear all** to remove them. To keep a filter when you clear the others, open its filter options and tick **Lock**. **Reset** removes that one filter. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-S6I9OEHG.png?sv=2026-02-06&spr=https&st=2026-11-24T14%3A43%3A15Z&se=2026-11-24T15%3A43%3A15Z&sr=b&sp=r&sig=nVRPfctyU%2F%2BPnI9avdXoB1IrIHofnEqHDPRxCIPCXyo%3D) ### Method 2: Group the rows Grouping turns the result into a tree: one row per group, which you can open to see the rows inside it. 1. Open the **Columns** side bar on the right of the grid. 2. Drag the column you want to group by into **Row Groups**. Drag in more columns to nest groups inside groups. 3. Select **>** beside a group to open it, and select it again to close it. The grouped values appear in a **Group** column on the left. To take the column's own copy out of the grid, untick it in the column list. To stop grouping by a column, select the **×** on its pill in **Row Groups**. Rows with no value form a group of their own. To show these empty values as **∅**, which distinguishes them from `''` values, turn on **Show nulls as ∅** on the **Data Virtualisation > Settings** page. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-8D6NL9TS.png?sv=2026-02-06&spr=https&st=2026-11-24T14%3A43%3A15Z&se=2026-11-24T15%3A43%3A15Z&sr=b&sp=r&sig=agSm%2FE9B3lzWgr%2BDnwob6iIHZGq7ek3pRnTQMtcbyUI%3D) #### Grouping by date You can group a date column by part of the date, for example to see one group per month: 1. Open the date column's menu and select **Group by Date Part**. 2. Choose **Year**, **Year-Month**, **Week** or **Hour**, or **Full date** to group by the whole date. To group by your own pattern, select **Custom date format** and type a `strftime` format, for example `%m/%d`. Hover over the information icon beside it for the codes you can use. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-V6VPBZFX.png?sv=2026-02-06&spr=https&st=2026-11-24T14%3A43%3A15Z&se=2026-11-24T15%3A43%3A15Z&sr=b&sp=r&sig=EaKny8XBchB%2FAeZZFG9Vc6%2BIvTu7Nv%2F4rI0DLYoAEcg%3D) ### Method 3: Add totals Totals show a figure for each group, a figure for the whole result in a footer under the grid, or both. 1. In the **Columns** side bar, drag the column you want to total into **Aggregations (groups / footer)**. 2. On its pill, select the function, for example **avg(pnl)**, and choose **Sum**, **Average**, **Minimum**, **Maximum**, **Median**, **Count**, **Count (distinct)**, **Same value** or **None**. 3. Select where the figure is shown: **Group rows**, **Footer**, or **Group rows and footer**. The pill shows your choice as **Groups**, **Footer** or **Both**. Without any row groups, every total goes in the footer. The footer labels each figure with its function, for example **Avg**, and is worked out over every row the filters leave. Hover over a footer figure to see which function it uses. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-HPGRPDAS.png?sv=2026-02-06&spr=https&st=2026-11-24T14%3A43%3A15Z&se=2026-11-24T15%3A43%3A15Z&sr=b&sp=r&sig=qIriH3U23KFGM0BQTiU8Bbst%2FSr93TAHAKjCFoDImFQ%3D) ### Method 4: Sum a selection of cells For a quick figure without changing the grid, select a range of cells by dragging across them. The bar under the grid shows their average, count, minimum, maximum and sum. ### Method 5: Save it with the query Filters, groupings, sorting and totals stay with the tab, even if you refresh the page. To keep them with the query, so they're there for anyone who opens it, save the query with **Save formattings** ticked. See [How do I format results?](/v1/docs/how-do-i-format-results#method-5-save-the-formatting-with-the-query) ## Troubleshooting ### A group doesn't list all its rows Large groups are fetched a page at a time as you scroll. The figures for each group are always worked out over all of its rows. ### A total doesn't appear on the group rows Check its pill in **Aggregations (groups / footer)**. A total placed on **Footer** shows only under the grid. Choose **Group rows and footer** to show it in both. ## Related articles - [How do I format results?](/v1/docs/how-do-i-format-results) - [Understanding the Query Editor workspace](/v1/docs/understanding-the-query-editor-workspace) - [How do I explore, group and chart results?](/v1/docs/how-do-i-explore-group-and-chart-results), for the same tasks in LumiCode