Queries - Grouping Your Data

Using groups in Queries

The main purpose of groups is to apply calculations to your data but you can add them to your query without also adding a calculation.

When you group your data, it will only show the unique values within the column you have selected.

To add a group, just click on the blue + button and select 'Grouped by' and then choose a column.

AddGroupGIFTo add more groups, simply click on the small + button next to your group.

Every time you add a new group, it will look for unique values across the columns you've grouped by.

Example

If we had two columns:

Owner - Has 5 different possible options: Rob, Norman, Jane, Sally & George

Status - Has 4 different possible options: Complete, In Progress, In Discussion & No Response

If we group by Owner, we'll see 5 rows of data, one for each of the Owners

If we then group by Status as well, we'll see a row of data for each combination of Owner and Status that exists within the data.

MultiGroupGIF

Reordering Groups

The order in which you add your groups can change the priority of what's displayed.

You can reorder your groups by clicking and holding the grab handle and moving the group to the left or the right.

Using the same example as above, if we swap the groups the Status column will take priority and the unique values in the Status column will be sorted alphabetically.

The columns don't switch order in the display so you would have to use the reorder columns button to change them if you wanted to.

ReorderGroupGIF

The more groups you add, the more granular your Query will be. Remember though, the Query will only show the columns you group by, so groups don't tend to add much value unless they are combined with Calculations.

Removing Groups

Groups can be removed individually or in bulk.

To remove an individual group just click the small X button next to the group in the Query sentence.

If you want to remove all of your groups, hover over the 'Grouped by' section heading and click the X. NOTE: This will remove anything that relies on those groups, such as calculations, filters and super columns.

RemoveGroupsGIF

For more on how groups work with calculations, read our article: Queries - Using Calculations

If you need further guidance on how to use Calculations, contact your account manager.

Related articles