Last updated: 2024-10-22

Source: https://support.freshdesk.com/support/solutions/articles/50000005530-creating-custom-metrics-in-analytics

Creating Custom metrics in Analytics

Here is a brief guide to all the functions and operators you can use to get started and build your own metrics:

What is a metric?

A metric is a number property that you can measure or operate on.

Example: Tickets reopened is a metric that measures the number of times a ticket was reopened

How to create custom metrics?

  • Goto Analytics tab from your left pane and click the Settings icon in the top-right corner.
  • Select “ Custom Metrics” from the side menu.
  • Create a custom metric while creating a new report:You can also create a custom metric from the chart configuration pane while creating a new report.
  • Click on “ Create Metric” to start creating your custom metrics by using a combination of functions or operators.
  • Once you develop your formula, you can test it by clicking on ' Check syntax'. If your formula is correct, there will be a green ' Valid' that will appear to the left of the 'Check syntax' button. You can also see a preview of your result in the 'Preview' window.
  • Click “ Save Metric” once done.
  • Use this custom metric for creating widgets or wherever required.
  • Note: Only users with edit and export access can create and modify the custom metrics.

    Custom metrics functions:

    You can use all the functions shown below to create and customize your existing metrics.

    COMMANDMEANING
    Function - Number
    fx CEILReturns the least integer greater than or equal to X<br>Example<br>CEIL (2.5) is 3
    fx FLOORReturns the largest integer lesser than or equal to X<br>Example<br>FLOOR (2.5) is 2
    fx ROUNDRound the number up to nearest integer value.<br>Example<br>ROUND (2.5) is 3
    fx EXPReturns the value of e (Euler's number) to the power of X<br>Example<br>EXP (2) is 7.38906
    fx GREATESTReturns greatest value among all fields<br>Example<br>GREATEST (1, 2, 3) returns 3
    fx LEASTReturns least value among all fields<br>Example<br>LEAST (1, 2, 3) returns 1
    fx LNReturns the value of the natural logarithm function of X (base e logarithm of X)<br>Example<br>LN (2) is 0.6931471805599453
    fx POWERReturns the value of X to the power of Y<br>Example<br>POWER (2, 3) will return 8
    fx SQRTReturns the value of the square root of X.<br>Example<br>SQRT (4) will return 2
    Function - Aggregator
    fx AVGReturns the average value of a numeric expression X<br>Example<br>AVG ( Number )
    fx MAXReturns the maximum value of a numeric expression X<br>Example<br>MAX ( Number )
    fx MINReturns the minimum value of a numeric expression X<br>Example<br>MIN ( Number )
    fx SUMReturns the sum value of a numeric expression X<br>Example<br>SUM ( Number )
    Function - Operators
    +Addition
    -Subtraction
    \*Multiplication
    /Division
    %Modular Division

    How to access the metrics you create?

  • Go to the Analytics Tab and select your report.
  • Click on edit in the top right corner
  • Search for the metric from the right pane. Choose the respective metric from the dropdown, click on Apply and add it to the widget.
  • Sample Metrics:

    1. Measuring efficient tickets resolved by calculating and subtracting them from reopened tickets. - Formula: Total(Tickets resolved) - total(tickets reopened) 2. Creating a metric called actual resolution time measures the time taken to resolve a ticket after it is in ‘X’ status to the time it was resolved. - Formula: Sum(Time spent in business hours) - Filter: list of statuses 3. Measuring the number of emails and not the number of customer interactions. Therefore the first email customer sends is the first email. - Formula: Total(customer interactions) + 1 4. Track a metric like “Total Replies,” which would be a combination of both “Agent Replies” and “Customer Replies”. - Formula: Total Replies = Agent reply count + Customer Reply count

    ``` Note: You can create custom metrics across different modules, meaning the metrics you define are not restricted to a single module. Combining data from multiple modules allows you to generate comprehensive reports tailored to your needs. ```