The GROUP BY Clause allows you to do summary calculations with aggregate functions (COUNT, SUM, AVG, MAX, MIN) on rows returned by grouping same values for the column(s) in the clause together. If you have more than one column in the clause, the values of the columns will be grouped in nested order of their group keys, starting from the smallest group key.
Because all non-aggregate columns in the select list must be in a GROUP BY clause, Instant Report automatically chooses these columns and displays them in the GROUP BY dialog box. All you need is to arrange their ordering by their group keys.
For example, the following query is invalid because columns a and b must be in a GROUP BY clause:
SELECT a, b, SUM(c)
FROM d
To fix the above query, GROUP BY a, b needs to be appended to the query.
To change the group key of group column, select the column, enter a group key number (1 for the first, 2 for the second, ....) and click on the Apply button. Do the same for any other group column you wish to change the group key.
Click on the Clear button to remove the group clause entirely from the query.