Query Tool
Explore your data interactively in Data Studio, and turn a query into a segment, an export, or a chart.
Your goal
Write a query, see the answer, and act on it - save it as a chart, turn it into a segment, or make it an export - without writing any code.
Expected outcome
Answers you trust, and reusable charts your team can load.
Who uses it, and for what
The Query Tool queries data with OTQL.
Build segments
Marketers
Do acceptance tests
Marketers, data analysts
Monitor data ingestion
Marketers, data analysts
Explore data
Marketers, data analysts
Build exports
Data analysts
The interface
Opening the Query Tool, you get:
A query builder to write OTQL queries.
Action buttons to save and share charts, save segments, create exports.
Query settings controlling how queries are run.
Your data model, so you can see which fields exist. See Schema definition.
Saved charts, a list of frequent queries and their visualisations, for you and your team.
Choose a data source
The selector above the query builder sets what you query. It shows OTQL by default.
OTQL
Your datamart, with an OTQL query you write. See OTQL.
Activities analytics
Information on UserActivity. See Data cube (Activities Analytics).
Resources usage
What your datamart consumes. See Monitor resource usage.
Collection volumes
The number of elements indexed in each collection. See Monitor collection volume.
Data ingestion
The events reaching each step of the ingestion pipeline. See Monitor data ingestion.
Segment metrics
Your segment metrics. See Segment metrics.
Activities analytics, Resources usage, Collection volumes and Data ingestion replace the query builder with a report form: Select a metric by a dimension for a period, which defaults to Last 7 days. Add a filter restricts the report to the elements whose dimension equals a value. New Value adds a metric, New series adds another request to the same tab, and Run executes the report.
What a result looks like
What you get back depends on what you asked for.
A single number: a volume of users, of events, an average transaction amount.
You can save the metric or create an export from it.
A distribution of values, produced by an aggregation such as @map, or by combining several metrics with New Value.
Series can be saved or exported, and displayed as a table, bar or column chart, radar, pie, or line and area chart.
A series whose key column holds dates. Same options as a regular series, plus control over how dates are formatted.
Area charts usually render these best.
Several requests in the same tab, added with New Series.
Multiple queries can be saved but cannot be exported.
A query returning metadata shows a sample of ten UserPoints as JSON.
To get a complete extract, create an export.
Query settings
These options change how a query runs, and some of them change the answer.
Evaluate the SELECT clause in GraphQL
Uses GraphQL for the selection. See GraphQL queries.
Use the cache
Returns a faster result if someone ran the request recently. Your query does not go into the cache if you do not select this option.
Precision - Full, Medium, or Low
Lower precisions execute faster.
Turning a query into something
Clear tabs
Returns to a clean state with a single tab.
Save this chart
Saves the query and its display, for later or for a dashboard.
Not available for queries returning JSON.
Save As User Query Segment
Creates a segment from the current query.
The query must be of the form SELECT {id} FROM UserPoint WHERE ....
Save As Export
Creates an export from the current query.
Save As Technical query
Creates a technical query, for use by developers.
Only one query.
Charts
Saved charts can be loaded by anyone with access to your organisation. On a loaded chart you can:
Share - creates a link that opens the chart in the Query Tool. It is a shortcut only: access is still governed by permissions on your organisation.
Update - save changes to the query or its display, and rename the chart.
Delete - note that if the chart is used in a dashboard, it disappears from the dashboard.
Verify
A count you can check independently - total UserPoints, for instance - matches.
Segment-bound queries were run at full precision.
A chart used in a dashboard is not deleted by accident.
Related pages
Last updated
Was this helpful?