With thanks toTaylor Bowserfrom Zendesk customer advocates.
A common request from Explore admins is to compare the volume of tickets (or any other metric) between two date ranges. In this Explore recipe, you'll find out how to usedate range calculated metricsto create a report showing the percentage variation in tickets created between yesterday and today. You can modify this report to suit your own business needs.
What you'll need
Skill level:容易
Time required:10 minutes
- Zendesk Explore Professional or Enterprise
- Editor or Admin permissions (seeGiving agents access to Explore)
- Ticket data in Zendesk Support
Creating the first metric
In this first procedure, you'll create a date range calculated metric that displays the number of tickets that were createdtoday.
To create the metric
- In Explore, click the reports () icon.
- In the Reports library, clickNew report.
- On theSelect a datasetpage, clickSupport>Support -Tickets, then clickStart report. The report builder opens.
- In the Calculations menu (), clickDate range calculated metric.
- On theDate range calculated metricpage, configure the following options:
- Name:Tickets created today
- Original metric:Tickets
- Defined on:Ticket created
- Date range:Simple>Today
- When you are finished, clickSave.
Creating the second metric
In this procedure, you'll create a date range calculated metric that displays the number of tickets that were createdyesterday.
To create the metric
- In Explore, click the reports () icon.
- In the Reports library, clickNew report.
- On theSelect a datasetpage, clickSupport>Support -Tickets, then clickStart report. The report builder opens.
- In the Calculations menu (), clickDate range calculated metric.
- On theDate range calculated metricpage, configure the following options:
- Name:Tickets created yesterday
- Original metric:Tickets
- Defined on:Ticket created
- Date range:Simple>Yesterday
Tip:You can use these metrics as the basis for your own reports. For example, you could report on Talk or Chat volume changes, or solved tickets instead of created tickets. For help with the available metrics and attributes, see thebuilding reportssection of the Explore documentation. - When you are finished, clickSave.
Creating the report
In this final procedure, you'll add the two date range calculated metrics you created and format them to create the final report.
To create the report
- In theMetricspanel of the report builder, clickAdd.
- From the list of metrics, expandCalculated metricsand choose the two date range calculated metrics you created,Tickets created todayandTickets created yesterday. When you are finished, clickApply.
- Ensure that theTickets created todaymetric appears first in theMetricspanel. If it doesn't, you can drag and drop it into the correct position.
- Click each metric you just added and change the aggregator to COUNT.
Your report will look like the following screenshot:
- In the visualization type menu (), clickKPI.
- In the chart configuration menu (), clickChart.
- On theChartpage, configure the following settings:
- Label:EnterTickets created today (and change since yesterday)
- Hide label:Uncheck this setting
- Show variation:Enable this setting
- Variation type:Set toPercentage
The report is now complete and will look similar to the screenshot below:
20 Comments
Hi, I did this, but when I add it to my dashboard and select the brand filter and the date range, the top number turns to 0 and the bottom percentage is 100%, regardless of which brand or month I choose. What am I doing wrong here?
Hi@...,
Thanks for reaching out! Sorry to hear you're running into issues when adding this query to a dashboard. I'm going to pull your request into a ticket so we can get a bit more information about your dashboard set up.
Best,
Hi, is there any chance that you can compare against a custom target? E.g. yesterday, our CSAT was 92%, and I want to compare it against our company KPI of 95%.
Any workarounds or additional information about the above?
Hi Shanaaz,
You can compare against a custom target by creating a Fixed Calculated Metric (https://support.zendesk.com/hc/en-us/articles/360022366973-Adding-fixed-calculated-metrics#topic_xdd_441_hy), which would essentially act as a constant and can be used in a comparison with the other metrics.
Warm Regards,
埃里克·g·高|技术支持架构师| zendk
Hello,
I am trying to find a way to show the variation (Percentage) on %Reopened Tickets Current Week VS Previous Week. I have not been able to get the results. Any help will be appreciated. Thank you.
Hello Zendesk Team,
In looking over this article, it seems that listed under Original Metric, Tickets is no longer a valid option. Using Tickets Created as the Original Metric and Ticket Created as Defined On seems to work.
然而,如果你想创建相同的指标or Solved tickets instead of Created tickets, does not seem to work. If you put in Tickets Solved for Original Metric and Ticket Solved for Defined On seems to cause the query to time out, provide no data, or throw an error saying that it exceeded the SQL limits.
If anyone has suggestions for how to create the same type of queries for Solved tickets, like the above created tickets, please let me know.
I have tried the directions on this article and it worked for me without any issue. Please refer to the values I have used and the resulting query.
If you encountered any issue feel free to contact our Support through Messaging.
Hi folks, I'm in need of some help if possible please :)
I would like to create a table which provides with insight on Tickets Solved (by tag) for the last week, and the previous week respectively.
Below is where I have got to so far, but it's not really what I'm looking for:
What I would like is for the first column to display how many tickets tagged in a certain way were Solved Last week (which I think I have achieved), and the second column to display how many tickets (tagged in the same way) were Solved thePreviousweek (i.e. the week before last). For now, I have simply used another metric. I know that I can create this manually via the date picker, but I was hoping there would be something less manual and more automated to achieve this.
Also, aVERYwelcome bonus would be to also have a third column which illustrates the percentage increase/decrease between the second column and the first.
Any help would be enormously appreciated! :)
Thanks in advance.
HiOliver Jackson, you should be able to do this by creating twodate range calculated metrics, one calledTickets solved last weekand one calledTickets solved week before last. For both, set theOriginal metricfield toSolved ticketsand theDefined onfield toTicket solved. When it comes time to choose the date range for each one, go to theAdvancedtab and:
Add the two metrics you just created in theMetricspanel (make sure youchange the aggregatortoD_COUNT).
Then, add theTicket tagsattribute in theRowspanel. If you want to see only certain tags in your report, you canfilter on this attribute.
And finally, to get the percentage change column, go to theResult manipulationmenu and selectResult metric calculation. In theFormulafield, insert yourTickets solved last weekmetric divided by yourTickets solved week before lastmetric.ClickAdd. (For more on result metric calculations, seethis article.)
When you click out of the result metric calculation window, you should see your new column. You can change its formatting by going to theChart configurationmenu and selectingDisplay format. Next to your % change metric, selectCustomand add aSuffixof%.
When you're all done, you should see a report similar to this:
Erin O'Callaghan
Hey Erin! I can't thank you enough for the explanation - so clear and effective. Really appreciate it.
I have one last hurdle however before the finish line: the data doesn't show me a percentage increase/decrease, but instead it appears to show the difference between the two values:
If we look at the example above,tech__reinstall_vcplusplusshows 100%, because it's an exact match, but in reality, I would like to display 0.0%.
With tickets taggedtech__reinstall_or_repair_dotnet, it's showing 94%, when in reality it should show-6%, and the same withauth_issuewhich should actually say-50% rather than50%.
Does that make sense? Hope you can help me with this final brainteaser! :)
Thanks again.
Oliver JacksonAh, good point! To get the percent increase or decrease, you can use this formula in your result metric calculation instead of the one I described above (just make sure to change the names of the metrics if you named them something different in your environment):
You can even go toChart configuration>Columnsand select theArrowcheckbox next to the last column to add a visual indicator of whether the number of solved tickets has increased (green arrow) or decreased (red arrow).
Erin O'CallaghanThank you so much for this - all fixed up now! :)
Sorry for my delayed response - caught Covid and was off for several days.
Cheers!
Is it possible to make a comparison of data YTD (e.g. tickets created) that you compare to the same period last year? The only examples I come across are line graphs showing the line from this year and last year. But no KPI's (for example) that show the data up to today compared to the value for that same period a year earlier.
Could this be the report you're trying to create from your end?
If yes, you can simply use theExplore recipe: Solved tickets this year compared to last yearas your guide but with some tweaks for your use-case.
Kindly see below how I configured the test report above:
Hope this helps! Stay safe!
Hi Elaine,
Thank you for your comprehensive comment. It is not completely what I am looking for. Or it doesn't do what I would expect: show me the tickets for this year (YTD), show me the tickets for the same period last year (YTD) and show the difference between them in %. Your example gives me this year (YTD of course), the whole of last year and no % (when I choose KPI).
What I've done myself is a variation on the example in this article. I've made two date range metrics (one for tickets created this year YTD) and one for one year in the past (last year YTD). I set them as D_COUNT and they give me the values I expect. So far so good. But when I try to calculate with them through a standard calculated metric (show me the difference in %), I get either 100% or a blank field. And I don't know what I'm doing wrong, because with other reports this method works perfectly. Do you know what I need to change to show the difference in %?
Screenshot ofThis year YTD
Screenshot ofLast year YTD
Screenshot of mycalculation for the difference in %
The result I get (using D_COUNT for the tickets and SUM for the calculated metric)
Hi Timo,
As your third custom metric is using the first two custom metrics in its formula, it should be created from theResult manipulation > Result metric calculationinstead of from theCalculations > Metrics > Standard calculated metricin this report.
The difference between the two methods is described in the articleUsing result manipulations and calculations.
Also, the formula to get the difference in % between two values (using your first two custom metrics) should be as follows:
Lastly, for you to show this metric in percentage, you need to go toChart configuration > Display format, look for the name of this metric, and set the dropdown fromStandardto%.
Here's an Explore recipe(check out steps 10-13) that will better explain and guide you on how to create the third custom metric.
I hope this clarifies it, Timo! Cheers!
Hi Elaine,
That was the trick! Thank you so much.
I usedErin O'Callaghanexample in the comments to compare last 7 days with previous 7 days it works perfectly, provided you dont want to use the Date filter in your dashboard.
So for example, if I do not select a date range I get the desired result.
However, as soon as I use the date filter to check a previous week the result is '0'.
Is there a way to adjust the calculation that the week selected in the date range is automatically compared to the previous period?
I'm afraid this is not possible. Rolling date range calculated metrics like your "Previous 7 days" report won't dynamically adjust based on the selected date/s in the filter. And this is why your date range calculated metric shows zero when you select a date/date range from the past. You may have to modify your reports so that the data is sliced or aggregated per week so that you will still be able to display values if you change the selected time frame in dashboard filters.
Pleasesign into leave a comment.