GROUP BY Query Fields
Click Add GROUP By to divide query results into separate buckets. For example, you could do a “group by” if you are interested in sorting items by timestamp, such as logins between 3 and 5 p.m. Functions on GROUP BY data apply to timestamp-based fields only.
After fields are added to Group By, the Conditions tab's subtab, Group Conditions, becomes enabled.
Tip: Fields in shown in italics on the Data Options panel are derived or referenced fields (rather than “hard event data” in the main database tables). See also, Data Fields and Variables.
Query Structure (GROUP BY)
The Query Structure section at the top provides a summary of the fields selected in the GROUP BY section at the bottom. SELECT and ORDER BY settings show up here also.
Adding and editing fields and variables to order by works similarly to adding them for SELECT. See Query Structure (SELECT).
Applying Time-Based Functions to GROUP BY Columns
You can specify a time-based function on the group by column of data. Time-based functions apply only to time-based fields, such as event end time.
To specify a function for GROUP BY column data, double-click a field or variable in the top pane under “GROUP BY” and select one of the available time-based functions (from the drop-down menu) to apply to the column data.
Functions on items under GROUP BY create a separate bucket of data for each time function specified.
To specify a function for column data, select a data field in the Query Columns section then select a Function (from the drop-down menu) to apply to the column data:
-
Second - Creates a new bucket for all events that occur in the same second.
-
Minute - Creates a new bucket for all events that occur in the same 60-second period.
-
Hour -Creates a new bucket for all events that occur in the same 60-minute period.
-
Day - Creates a new bucket for all events that occur in the same 24-hour period.
-
DayofWeek - Creates a new bucket for all events that occur on the different days of the week, such as Monday, Tuesday, and Wednesday.
-
DayofMonth - Creates a new bucket for all events that occur on various days of the month, such as the first, second, and third.
-
Week - Creates a new bucket for all events that occur in a week.
-
Month -Creates a new bucket for all events that occur in a month.
-
Year - Creates a new bucket for all events that occur in a year.
-
Quarter - Creates a new bucket for all events that occur in a quarter.