*Result metric calculations* enable you to add a further calculation to a query you have
already taken. For example, if you've created a query to calculate a cost of service for your
tickets (see Calculating estimated cost of service for an example),
and you want to add a ten percent margin to this, you could use a result metric calculation.

## Creating a result metric calculation

**To create a result metric calculation**

- With an Explore query open, click the result manipulation menu (), then select
**Result metric calculation**. - Click
**Add a new metric**. - On the
**Result metric calculation**panel, enter the name of your metric. - Enter your formula. For help writing formulas, see Writing Explore formulas.
- Select
**Clear used metrics**to hide other metrics from the query results and only show the result metric calculation. The metrics are still used in the result metric calculation, but the results will not appear in your chart. - Click
**Add**, then close the**Result metric calculation**panel. The new result metric calculation is added to the query. - Your calculation is automatically added to the open query.
- In your query, click
**Save**.

## Example: Calculating the percentage of on-hold tickets

In this example, you'll create a query that shows the total number of tickets, and the number of on-hold tickets for any given year. Then, you'll add a result metric calculation that displays the percentage of on-hold tickets.

## Creating the query

**To create the query**

- In Explore, create a new query using the
**Support: Tickets**dataset. - In the
**Metrics**panel, add the following metrics:**COUNT(Tickets)****COUNT(On-hold tickets)**

- In the
**Filters**panel, add the following attribute:**Ticket created - Year**

- From the visualization type menu (), choose
**Table**.Explore displays a table showing the total number of tickets and the number of on-hold tickets. You can click the

**Ticket created - Year**filter to filter your results to specific years. - Enter a name for the query, then click
**Save**.

## Adding the result metric calculation

**To add the result metric calculation**

- With an Explore query open, click the result manipulation menu (), then select
**Result metric calculation**. - Click
**Add a new metric**. - On the
**Result metric calculation**panel, enter the name of your metric,**Percentage of on-hold tickets**. - Enter the following
formula:
`COUNT(On-hold tickets)/COUNT(Tickets)`

The

**Result metric calculation**panel will look like the following example: - Click
**Add**, then close the**Result metric calculation**panel. The new result metric calculation is added to the query. - Next, you need to display the new calculation as a percentage. In the chart
configuration menu (), click
**Display format**. - On the
**Display format**panel, click the drop-down list next to your metric,**SUM(Percentage of on-hold tickets)**. - From the list of display formats, choose percentage, (
**%**). The result metric calculation in your query now displays a percentage. - In your query, click
**Save**.

## 32 Comments

Hi Matt,

With the use case that you presented, I think the

Date range calculated metricswould help you out on this. You can check the article Adding time and date calculated metrics regarding this one.You can use data for a quarter of a year under the

Advanced tabandAdd a repeat patternwithin the calculated metric to compare the current quarter to another quarter of the same year or a different year.For more information about adding a repeat pattern, you can check the article Editing dates and date ranges. Hope this helps! :)

Thanks for the reply Elaine Hilario!

I didn't have much luck with the repeat pattern - it seemed to just lump the previous periods' data into the number shown.

Correct me if I'm wrong, but I think by using the two metrics for different quarters I've achieved the result I was looking for?

Please sign in to leave a comment.