Explore's built-in metrics and attributes give you great flexibility to create reports. However, every business is different, and eventually you might want to create reports using metrics and attributes that aren't included in Explore by default. To bridge this gap, you can create standard calculated metrics and standard calculated attributes.
This article contains the following sections:
Related articles:
Understanding standard calculated metrics and attributes
Standard calculated metrics and attributes allow you to create new metrics and attributes by combining default metrics and attributes with a variety of formulas, mathematical functions, and more. For example, you could create a standard calculated metric to return a per-hour cost, or create a standard calculated attribute to return a value based on a certain condition.
Standard calculated metrics and attributes are located in the Calculations menu () in the right sidebar of the Explore report builder.
As with default metrics and attributes, you need to add standard calculated metrics and attributes to your report after creating them (see Using metrics and attributes in reports).
Creating a standard calculated metric
IF ([Ticket channel]="Email") THEN [Ticket ID] ENDIF
To create a standard calculated metric
- In Explore, create a new report or open an existing one.
- Click the Calculations menu (
) and select Standard calculated metric.
- In the Name field, enter a descriptive name for your new metric.Note: Don’t include quotation marks, parentheses, or square brackets in the name. Doing so will cause errors if the metric is referenced in another calculated metric or attribute, or in a result metric calculation.
- In the Formula field, type or paste the formula that the metric should use. If
you type your formula, you can click the auto-complete suggestions as they
appear.
Alternatively, you can click the following fields to select elements to add to your formula:
- Fields > Select a field: Shows a list of existing metrics and attributes, including default and custom.
- Functions > Add: Shows a list of available functions. For more information about each one, see Explore functions reference.
- If your formula uses existing calculated metrics and attributes and you don't want to affect their original calculations, select Compute separately .
- Click Save. The metric is saved to the dataset you selected when you started the report.
You can now add this calculated metric to your report. When you click Add in the Metrics panel, you'll find your metric in the Calculated metrics folder.
Creating a standard calculated attribute
Standard calculated attributes allow you to create new, custom attributes to add to your reports. For example, you could create a standard calculated attribute that groups results based on defined values. See Creating standard calculated metrics and attributes: Hands-on tutorial.
To create a standard calculated attribute
- In Explore, create a new report or open an existing one.
- Click the Calculations menu (
) and select Standard calculated attribute.
- In the Name field, enter a descriptive name for your new attribute.Note: Don’t include quotation marks in the name. Doing so will cause errors if the attribute is referenced in another calculated metric or attribute.
- In the Formula field, type or paste the formula that the metric should use. If
you type your formula, you can click the auto-complete suggestions as they
appear.
Alternatively, you can click the following fields to select elements to add to your formula:
- Fields > Select a field: Lists the existing metrics and attributes, including default and custom.
- Functions > Add: Lists the available functions. For more information about each one, see Explore functions reference.
- Configure the additional settings as needed:
-
Computed from: Lists the metrics and attributes you can use in your
standard calculated attribute. Important: Although you can select standard calculated metrics from the list, doing so can lead to inaccurate results and is not supported. Use only default metrics in your standard calculated attributes.
-
Sort like time attribute: If your calculated attribute represents a date,
this option places your date values in the correct order.Note: This option applies only to single attributes. Combining attributes, such as adding a year to the end of a month, results in alphabetical sorting instead of chronological.
-
Computed from: Lists the metrics and attributes you can use in your
standard calculated attribute.
- Click Save. The attribute is saved to the dataset you selected when you started the report.
You can now add this calculated attribute to your report. When you click Add in the Columns, Rows, Explosions, or Filters panels, you'll find your attribute in the Calculated attributes folder.
Next steps
Now that you understand the basics of creating standard calculated metrics and attributes, you're ready to put this knowledge into practice. See Creating standard calculated metrics and attributes: Hands-on tutorial to practice creating a calculated attribute by working through an example.
58 comments
Walter
Hi Lea, did you use those formulas to create calculated attributes or metrics? In my test, I created calculated attributes. When used in the rows, it will show the ticket ID (assuming you are using a table instead of a chart).
0
Lea Møller Baun
Hello Walter, yes, I used the formulas that you send to make 2 standard calculated attributes. What do you use as metrics? Because I tried to make one with solved tickets, with just tickets etc, but it doesnt seem to be working for me for some odd reason.
0
Walter
Hi Lea Møller Baun, I tested these formulas based on the following environment:
The formula can be used as both a Calculated Attribute or a Calculated Metric.
Below is a sample from a sandbox.
Maybe you can try on a blank report first to confirm if the formula works for you. Then, try to figure out if there is anything in your current report that is having an effect on the result.
0
Lara McCaleb
I'm trying to create a standard calculated metric that shows me the % of solved tickets by assignee (part of a preexisting set) out of total solved tickets. I'm able to achieve this by using result path manipulation in a single report, however I'd like to be able to show the metrics side by side in the same report: Count Solved | % Solved. Can someone help me in creating this metric?
0
Hiedi Kysther
Hi Lara McCaleb,
To better assist you on this issue, I've created a ticket on your behalf. Please check your email for more information. Have a great day!
0
Sean Nelson
I am trying to create a calculated metrics based on custom fields and a separate calculated metric, the formula shows the green check mark when I am generating it, but no value is displayed on the report when I use it. What am I doing wrong?
I am trying to track the accuracy rate of work we are tracking in custom fields:
Tickets Added vs Errors. Report level filters either allow more data than I need (other errors that are not needed in this report) or eliminate data that I do need (total tickets added).
I created the calculated metric "Total Ticket Setup Errors" with an IF THEN formula to focus just on the errors that are related to Ticket Setup work, but it appears that I cannot create a new calculated metric using the values from that calculated metric.
Any thoughts?
0
Saxon Clay
Sean Nelson without knowing the guts and nuances of those metrics/fields for your particular organization I'd suggest either trying to use a custom attribute as a report filter instead of the custom calculated metric, or using the 'Result Metric Calculation' field in Result Manipulation which lets you perform arithmetic with existing metrics in the report
0
Sean Nelson
Thanks Saxon Clay - that is helpful, using Result Metric Calculation - is there a way to adjust the display format? Trying for % but would settle for something other the a whole number, 99% accuracy is displaying as 1.
0
Saxon Clay
Sean Nelson Yeah you can tweak display formats for your metrics in Chart Configuration > Display Format. Setting the result metric to '%' will probably do what you're looking for, you can also set it to Custom to get a bit more customization like decimal places
0
Sean Nelson
Saxon Clay - Bingo! Exactly what I needed, thanks!
0
Anton Christoffersen
Dane your suggestion for grouping orgnazations worked like a champ. I am now stuck on how to report on month and year combined in a calculated attribute.
In this article it says it will sort them alphabetically - is there any way around that?
0
Bruce Willis
Hi!
I'm having some issues finding a solution for a dashboard:
I have created a dashboard including two different reports:
A-tickets created belonging to a selected number of brands
B-tickets received by a single email.
I would like to present the A/B ratio and I expected to be able to perform this calculation in the dashboard.
Is there a way to do this?
Thank you!
0
Walter
Hi Bruce Willis,
If A and B are from the same dataset, then you could create a calculated metric in a third report and use the KPI visual.
0
Graham
Not sure if this is the right place for this but I am trying to create a field that is updated automatically dependant on the results in other fields - Essentially inputting Urgency and Impact scores to create a Priority score that is calculated from those other fields. Is this possible within Zendesk and how would I go about creating it?
0
Dane
We only have conditional fields. It does not have the capability to calculate values of other fields. However, you can leverage the use of triggers to designate such values for those fields.
For example, you have Urgency and Impact field that will determine the value of Priority. Your trigger can look like this:
Meet ALL of the following conditions
Ticket > Urgency is (Whatever value)
Ticket > Impact is (Whatever value)
Actions
Ticket > Priority is (Whatever Value).
If you feel this isn’t sufficient feel free to provide feedback in the Community page.
This is to engage with other users who have similar needs and discuss possible workarounds. Conversations with a high level of engagement ultimately get flagged for product managers to review when they go through roadmap planning.
0
Greg Kalfayan
Apologies for what I am sure is a very basic question, but I am attempting to divide one column in my report by another, and cannot figure out the formula.
I want to divide the second column by the first column in the attached images, but values aren't supported in calculated metrics.
0
Julia DiGregorio
Greg Kalfayan - try using count instead of Value
0
Greg Kalfayan
Thanks for the quick response Julia DiGregorio. I tried and it's not returning the desired value.
For example highlighted below, I'd want the report to calculate 13,596/183,862 and return 0.07. Instead it's returning 17.
0
Julia DiGregorio
Greg Kalfayan - Sorry for the delayed response. What you want to use is the following:
https://support.zendesk.com/hc/en-us/articles/4408831485466-Using-result-metric-calculations
I just tried it and it worked great
0
Debra Velez
Hi,
I am trying to add a column to a query to indicate whether an agent is an internal or external resource. This is defined by the assignee's email address.
The following formula shows an error message when trying to add this attribute:
IF (CONTAINS([Assignee email]]),"@example.com"))
THEN "External"
ELSE "Internal"
ENDIF
What can I do to correct this?
0
Brandon (729)
Hey Debra,
It looks like you might have an extra closing square bracket after [Assignee Email].
Let me know if that resolves your issue.
Brandon
0
Francisca Belén Troncoso
Hi,
I am trying to obtain percentage of requester who have requested a ticket with "birdie" tag versus total requesters. Any idea?
Thanks
0
Gab
To create the report
See Chart types for comparing values to total results for more information on using charts to evaluate total results.
I hope this helps.
0
Vaibhav Shetty
is there a way to calculate how long it took to solve the ticket after it got created, we have created a custom attribute to calculate the days, but we want to exclude the Saturday and Sunday from the calculated days can someone help me on the below formula
DATE_DIFF([Ticket solved - Date],[Ticket created - Date],"nb_of_days"). please anyone help me on this
0
Tony
As it is now, the DATE_DIFF doesn't exclude days so it is not possible to use it with business hours or by excluding days.
Here is an article where you can find all the functions: Explore functions reference. I hope this helps.
Best,
Best,
0
Vaibhav Shetty
Hi Tony thank you for the reply can you please help us creating a formula for calculating how many business days it took to solve the ticket after it got created
we are new to creating custom attributes and metrics because of that we are stuck in this case can you please help us
0
Tony
I'm sorry but for custom formulas I suggest you to get in touch with our professional service or to check other posts where you might find more hints on how to achieve that!
Best,
0
Vladimir P
Hi there,
Would some be able please to help to put an attribute together which would return me requester first comment in a table in Explore.
There is a placeholder in Zendesk for it ticket.description however, there isn't an attribute or metric for it in Explore. We need that attribute(or metric)
Thanks a lot!
0