In this Explore recipe, you'll learn how to create a query that shows the top problem tickets by number of unsolved incidents that are attached. If you're not familiar with working with problem type tickets, check out Working with problem and incident tickets.
What you'll need
Skill level: Moderate
Time Required: 20 minutes
- Zendesk Explore Professional or Enterprise
- Editor or Admin permissions (see Giving agents access to Explore)
- Ticket data in Zendesk Support
Creating the query
To create the query
- In Explore, click the query () icon.
- In the Queries library, click New query.
- On the Choose a dataset page, click Support > Tickets > Support: Tickets, then click New query. Query builder opens.
- In the Metrics panel, click Add.
- From the list of metrics, choose Tickets > Incidents, then click Apply.
- In the Rows panel, click Add.
- From the list of attributes, choose Ticket > Ticket problem ID, then click Apply.
- Now, add a filter to exclude incidents that are not connected to problem tickets. Click the Ticket problem ID attribute, then click the Excluded tab. Select Null to exclude any null values.
- Now, create a custom Standard calculated metric to calculate the number of incidents that are currently unsolved. Click Calculations (), and then click Standard calculated metric.
- Copy the formula below and paste it into the metric editor.
IF ([Ticket type - Unsorted] = "Incident" AND (([Ticket status - Unsorted] != "Solved")
AND ([Ticket status - Unsorted] != "Closed")))
THEN [Ticket ID]
- Give the metric a name like Unsolved incidents. The metric will look like the screenshot below:
Tip: If you're working in a language other than English, read this article to help you enter Explore formulas in your language.
- From the Metrics panel, add the new metric Calculated metrics > Unsolved incidents. Ensure the metric aggregator is set to COUNT. For more information, see Choosing metric aggregators.
- Now, add the percentage detail using a Result metric calculation. Click Result manipulation (), then select Result metric calculation.
- On the Result metric calculation page, click Add a new metric.
- Enter the name of your metric.
- Enter the formula below. You must select your metrics and functions from the drop-down list next to Insert.
- Click + Add to add the calculation.
- The final step is to edit the query to show the new calculation in a percentage format. Click Chart configuration (), then Display format. Then change the calculation metric to display in %.
The query is now complete. See the screenshot below for an example.
If you want to filter this report by the problem tickets with the most incidents, you can apply a top/bottom filter. Check out Creating a top/bottom filter for further instructions.