In this Explore recipe, you'll learn how to create a query that shows you when an organization last submitted a ticket.
What you'll need
Skill level: Moderate
Time Required: 20 minutes
- Zendesk Explore Professional
- Editor or Admin permissions (see Adding users to Explore)
- Ticket data in Zendesk Support
Creating the query
To create the query
- In Zendesk Explore, click the query () icon.
- In the Queries Library, click New Query.
- Now, select a dataset containing the ticket data you'll need to build the query.
Select Zendesk: Tickets. Query Builder opens.
- Now, create a Standard calculated metric to show the number of days since a ticket was created and today's date. Click Calculations (), and then Standard calculated metric.
- Copy the metric below and paste it into the metric editor. Add a title for the metric like Number of days between today and date ticket created. It will look like the screenshot below:
DATE_DIFF(TODAY(),[Ticket created - Timestamp],"nb_of_days")
- In the Metrics panel, click Add.
- From the list of metrics, expand Calculated metrics, click the custom metric you created, Number of days between today and date ticket created, then click Apply.
- Ensure the metric aggregator for Number of days between today and date ticket created is set to SUM. For more information, see Choosing metric aggregators.
- In the Rows panel, click Add.
- From the list of attributes, expand Ticket, click Ticket ID, then click Apply.
- In the Explosions panel, click Add.
- From the list of attributes, expand Requester organization, click Requester organization name, then click Apply.
- (Optional) Click on Requester organization name and exclude NULL. This will exclude results where the requester does not belong to an organization.
- Click Result manipulation () then Top/bottom. Set per the below:
- Bottom: 1 result
- Metric: SUM(Number of days between today and date ticket created)
- Strategy: On rows
Then the query is complete. Check out the screenshot below as an example.