Working with aggregation-level functions

Return to top


  • Vladimir Petrushenko

    hi @... 

    Thanks for this. That looks interesting . Our agents keep asking how they can compare their Monthly Sat score against the average Sat score in last 12 months. So the query would have bars of Sat score for recent months and then a trend line with average Sat score for 2021. The agent then would be able to see how their current month's Sat score is trending against average. Feels like a simple functionality, but we can't get this working. Would these new features help to build that? Tried few variations but can't seem to get it working 

  • Shai Sy Dimayuga

    Hi Vladimir,

    We may need to look into this further so a separate ticket will be created on your behalf where we can continue to look into the this.


  • Aya Ahmad

    Question, what would be the formula to compare an agents Average Full Time Resolution to the Team's Average Full Time Resolution? In Hours. 

    Can you use Attribute_Fix? 

  • Gab Guinto
    Zendesk Customer Care
    Hi Aya,
    If you're looking to display each agent's resolution time and the groups' averages then, yes, you can use attribute_fix to build a metric that will only be sliced by ticket group. But, if what you're trying to do is to compare individual resolution times with the entire team's (not the ticket/agent group's) average resolution time, then you might want to use a fixed calculated metric (Adding fixed calculated metrics).
  • Crawford Philleo

    Hey there - 

    I'm having a tough time getting the ATTRIBUTE_FIX function to load metrics consistently on queries in the Ticket Updates data set. I thought this could be useful to build a metric have a count of Tickets created or solved by month, while also being able to slice another metric like Handling Time by various attributes (like individual agents or groups of agents) so you could measure those against total volume per month on a time series. I'm getting time-outs if I go beyond like a day's worth of data using the "Update - Date" time attribute as a filter, but when I just look at that one day, it looks correct. Does the ATTRIBUTE_FIX function not really work as well for the Ticket Updates data set or is there something inherently wrong with my approach?

  • Rosie Balagbis
    Zendesk Customer Care
    Hi Crawford, 
    Attribute functions could be used in any dataset. Let me go ahead and create a separate ticket on your behalf so I can get more account-specific details to troubleshoot this issue. Please expect an email shortly with the ticket information. 
  • Laura Dell'Angela


    Thanks for this article first of all. The use case of ATTRIBUTE_FIX seems pretty clear to me. However, I am having some trouble understanding the purpose of the ATTRIBUTE_ADD. In theory it makes sense, but I am confused in regards to the last example: 'Display the maximum number of tickets received from one channel in a month without showing the channel names'.


    My confusion is this:

    The metric returns the maximum number of tickets received by ALL channels in a month. In this case, why should we not just use the default COUNT(tickets) metric?

    However, if we want to return the maximum number of tickets received by ONE (and only one) channel, must we not add a filter to the metric, choosing just one channel?

    This does not seem clear in the article. Thank you in advance for your help!


  • Dainne Lucena
    Zendesk Customer Care

    Hi Laura Dell'Angela


    That's a great question. As the article described, "This example illustrates using the ATTRIBUTE_ADD function which slices the metric you specify by all attributes in the report plus the one you specify."

    As you can see, the ATTRIBUTE_ADD actually uses the COUNT(ticket) metric for the custom-calculated metric in the samples:

    ATTRIBUTE_ADD(COUNT(Tickets), [Ticket channel])
    ATTRIBUTE_ADD(COUNT(Tickets), [Ticket created - Year])

    This is for scenarios just like in the article where you want to display results without needing to slice the data, So instead of adding COUNT (tickets) + the attribute for tickets created in a year, since you don't want to list down the years and want just an average, you'd create your own metric with the ATTRIBUTE_ADD. 

    Hope this clears things out! Let me know if you have any follow-up questions.

  • Laura Dell'Angela

    Hello Dainne Lucena,

    Thanks for your reply.

    My question however still prevails.

    In the example that you provide, the results of what year are being rendered? Wouldn't you have to specify which year?

  • Dainne Lucena
    Zendesk Customer Care

    It would be for all the years since the ATTRIBUTE_ADD returns the value of aggregator(metric name) aggregated to all attributes in the report in addition to attribute1 and attribute2.

  • Andrei Kamarouski
    Community Moderator
    The Wise One - 2021

    Hi Eugene Orman, I need your expert help =) 

    I am using this formula to find the global average of Solved tickets in the whole Zendesk instance (it has just one single brand). I can slice the reports with this metric by Dat Solved to have the average per any time period. 

    ATTRIBUTE_FIX(COUNT(Solved tickets), [Ticket brand])

    However, it doesn't work when there are multiple brands in Zendesk (because giving the average per brand). Is there really any attribute that is a global one for the whole Zendesk instance that has multiple brands? Can't find anything and custom attributes don't seem to work here as well. 


Please sign in to leave a comment.

Powered by Zendesk