In Explore, you display your data in customizable reports, or queries. Explore comes with pre-built dashboards containing many common reports; however, you might want to modify these queries to suit your needs, or create your own queries.
Use this article to learn how to create your own Explore queries. If you want to learn more about how to modify the queries on the pre-built dashboards, see Getting started modifying queries.
This article contains the following topics:
What are queries?
Queries are questions you ask about the information stored in your Zendesk account. For example you could ask "What percentage of this month's tickets have a priority of urgent?" or "Which agents have solved the most tickets this month?".
You create queries in the query builder. If you want to learn more about navigating the Query Builder, see Getting started with the Explore interface.
Queries are stored in the queries library. You can open the queries library anytime by clicking the () icon on the left sidebar.
Creating your own queries
Before you create a query, you need to define the data source containing the business information you want to report about. Explore uses datasets that connect you to information about Zendesk products like Talk, and Support. Typically, you will simply connect to one of the existing datasets for the product you want to query. More advanced users might create new datasets for testing and customization purposes.
You must select a dataset before you can create a query. When you create a query, you will be prompted to choose the dataset you want. For more detailed information, and to see the currently available datasets, see Working with datasets.
To create a new query
- From the queries library, click New query.
- From the list of datasets, choose the one you want, then click Select.
The query builder opens showing a new, blank query.
See Creating queries for more information and to find out about other ways you can create queries.
This section gives you the basics you need to start building queries. You'll then learn about some of the ways in which you can customize queries to suit your own business needs.
Adding metrics and attributes
A typical query contains the following:
- Metrics: Quantifiable data, or things you measure like number of tickets, or number of replies.
- Attributes: Qualitative data like dates, groups, and tags. These 'slice' the results from your metric by the values in the attribute.
For example the attribute Assignee name would list your different Zendesk Support assignee names as the values. If your query includes the Tickets metric and the Assignee name attribute, Explore displays the number of tickets for each assignee.
- Columns renders your results in one chart. See Adding attributes to Columns.
- Rows renders your results into individual charts or tables for each of your attribute values by using a row selector. See Adding attributes to Rows.
- Explosions renders your results into multiple charts, each representing a different value for the added attributes. Charts are shown side-by-side in one query. See Adding attributes to Explosions.
- Filters restricts which results are shown without the attribute appearing on your query. See Adding attributes to Filters.
A query must contain at least one metric. You can add metrics in different sizes, colors, on a dual axis, to a trend line, or include them in datatips. You can calculate your metric results in different ways, such as summation (SUM) or count (COUNT). You can see what calculation is currently applied by looking at the aggregator in front of the metric name. Explore will automatically apply a default aggregator, but you can select a new one. See Changing metric aggregators.
For more information on adding metrics and attributes, see Adding metrics and attributes to your query.
Selecting a visualization
Visualizations help you display your data in the format you want. Once you add metrics and attributes to your query, Explore automatically renders your query in the most suitable format. You can change the chart type in the Visualization type () menu on the right sidebar.
For details, see Visualization types reference.
Saving your query
When you finish building your query, click Save. For more information about saving queries, see Saving your query.
After you add your data, you can begin to customize your query to suit your business needs. In query builder, you can find the customization options on the right sidebar . There are three menus containing customization options.
In addition to visualizations, you can also customize your query using the chart configuration menu (), on the right sidebar. It contains all your primary customization options, such as chart color, text formatting, and additional options unique to each type of visualization. For information about the options available in the chart configuration menu, see Customizing your query
Example customization: Change a chart's color
In this example, you'll change the color of a chart. Experiment with the other options to see the difference it makes to your chart.
- Click the Chart configuration menu icon () on the right sidebar.
- Select the Colors option.
- Under Automatic color, click the color swatch in front of the metric name or click Apply predefined palette. The predefined palettes contains Explore's suggested color groups.
- Select a color, then click Select.
- Click the Chart configuration menu icon again to close the menu.
Your query will be updated with the new color. Make sure to save your query before navigating away from the query builder (see Saving your query).
For more details, see Customizing queries.
Performing calculations and creating custom metrics and attributes
Explore features many tools that can perform calculations on your data to analyze results such as the total, percentage, or future values. Explore makes calculations easy for you through result manipulations. In addition to result manipulations, you can also create completely new metrics and attributes using functions and pre-existing formulas with Explore's Calculation engine.
About result manipulations
Result manipulations enable you to apply calculations like totals, percentage difference, and more. You can also use result manipulations to hide, sort, restrict, and predict future results. Unlike Explore's calculated metrics and attributes, you do not need to write any formulas.
Result manipulations are located in the Result manipulation menu (). The result manipulation menu is the third menu on the right sidebar (see Result manipulations reference). When you click the result manipulation menu icon (), you'll see several calculation options you can apply to your report.
Result manipulations are applied after your metrics and attributes are processed in the query, and they will appear on the Filters bar above Filters. If you add several result manipulations, the order you apply the result manipulations might affect the outcome of your result. See Setting the order for your result manipulations for more information.
For information on the different types of result manipulations and how to add them, see Calculation types reference.
About custom metrics and attributes
Sometimes, the pre-built metrics and attributes supplied with Explore might be insufficient for your needs. In this case, you might be able to create custom metrics and attributes or calculated metrics and calculated attributes to get the results you need. You can use calculated metrics and attributes to create unchanging metric results (like a per hour cost), rename attribute values, create completely custom new metrics and attributes, and more.
Calculated metrics and attributes are located in the Calculations menu ().
For a list of the available calculated metrics and attributes and how to add them, see Calculated metric and attribute reference.
Like your normal metrics and attributes, you will need to add calculated metrics and attributes to your query by selecting them from the one of the metric or attribute locations (see Adding metrics and attributes). When you add a calculated metric or attribute to your query first, it will filter your results before they are processed. Calculated metrics and attributes can help speed up loading time for large datasets by filtering results before they are processed.
To get a great start creating custom metrics and attributes, see Getting started with custom metrics and attributes.