Query Builder Overview

The Query Builder is where Analytics analyses are built. It is located at the top of the Segmentation, Funnel, Cohort, and User Insights tools.

In this article, we’ll explore the functions of query rows, the core components of an Analytics analysis.

Rows in the Query Builder

Query Builder 1

Query Rows represent user actions. A row may contain any combination of events, event properties, and user properties. Rows in the query builder are numbered for easy identification in analysis results.

Create a Query Row

Query Builder 2

Every row begins with an initial event. To add an event to a query builder, you can click on + Select an Event

Once an event is added, additional clauses and filters may be added:

Label a Query Row

Query Builder 3

Each query row may have a custom annotation added to it. This allows you to organize your analysis, improve readability, and ensure that data points in analysis results are appropriately labeled. These labels remain a part of the query when saved, added to a dashboard, or shared via URL.

Collapse the Query Builder

Query Builder 4

To collapse the query builder, choose the collapse icon. It is located on the right hand side of the query builder at the bottom of the query rows. Collapsing the query row does not affect the analysis, it only reduces the size of the query builder. To expand the query builder again, select the expand icon.

Save a Query Row as a Custom Event

Query Builder 5

Some query rows may be saved as custom events. Query rows may be saved as custom events if they consist of a single event and/or contain one or more Filter Where clauses. Use custom events to save query rows that you create frequently.

To be saved as a custom event, a row:

  • Must contain 1 event, and no For clauses
  • May contain an unlimited number of Where clauses
  • Must not contain By clauses

Once saved, the new event will appear in the Data Panel.

Duplicate a Query Row

Query Builder 6

When creating variations of an existing row, Duplicate in the query row menu enables you to easily clone rows for modification.

Deactivate a Query Row

Query Builder 7

Hiding a query row excludes it from analysis results, but does not delete it. This can be useful for viewing analysis components individually, or tentatively excluding rows as you progress through an analysis.

To deactivate a row, go to the right of the event and select the deactivate button. You can reactivate the row by selecting the Activate button.

Delete a Query Row

Query Builder 8

Deleting a query row will permanently remove it from the query. To delete a row, navigate to the right side of an event and choose the delete button.

Was this page helpful?