Insights tag reporting: Reporting on tickets with one or more tags (Professional and Enterprise) Follow

Comments

32 comments

  • Avatar
    Zach Hanes

    Is it possible to apply this filtration at the level of a custom metric, rather than applying the filter to the whole report?

    I have several tags that I would like to compare on a single report, rather than creating a separate report for each tag. Essentially, I'm trying to find a way to slice # Replies [Avg] by a select number of tags.

  • Avatar
    Joseph Black

    Hi Zach,

    The numeric range filter is basically forcing the metric to run for each Ticket Id and then seeing if that ticket matches the conditions (counting "1" ticket if it has that tag). To get this working within a metric we need to set up this as a filter clause using MAQL:

    SELECT # Replies [Avg] WHERE (SELECT (SELECT # Tickets WHERE Ticket Tag = billing) BY Ticket Id) = 1

    Replace "billing" with whatever tag you want to report on. I believe this should work but let me know if you run into any snags.

  • Avatar
    Sean Cuevas (Edited )

    Hi There,

    How would I create a metric that only returns tickets that have two specific tags? I too am trying to avoid using filters for this.

  • Avatar
    Joseph Black

    Hi Sean,

    If you nest metrics you can make separate calculations on the same ticket, allowing you to check for combinations of tags:

    SELECT # Tickets WHERE (SELECT # Tickets BY Ticket Id WHERE Ticket Tag = article_viewer) = 1 AND (SELECT # Tickets BY Ticket Id WHERE Ticket Tag = houston) = 1

    I haven't had the opportunity to QA this extensively but from my preliminary testing it appears to work.

  • Avatar
    Sean Cuevas

    Perfect. Thank you Joseph.

  • Avatar
    Martin Siwy (Edited )

    This is great! Can you track the time in (days or hours) from when the specific tag was added and report it? If not, what would be a work around? I am trying to create a report to see how long a ticket "sits" in a specific stage. Thanks!

  • Avatar
    Matt Hoffman

    Hi Martin -

    The "Events Dataset" is what allows you to report on when specific changes happened to a ticket, historically (as opposed to simply reporting on a ticket's present day state). Unfortunately, the Ticket Tags dataset is not connected to the Events dataset and therefore you cannot report on when a tag was added to or removed from a ticket.

    The way to report on duration is to report on when a Ticket Field (numeric or text) changes - this could be anything from Assignee, Group, or Status to any of your Custom Fields. Here are 2 great resources for learning more on that:

    Building Custom Metrics for the Events Model

    Duration between two events in minutes

    I hope this helps! If you have questions, just drop us a line at support@zendesk.com

  • Avatar
    Jessie Schutz

    Hey everyone!

    I just wanted to hop in here and let you know that we've revamped this article to include additional information and clarify some things. Be sure to give it a look! 

     

  • Avatar
    Justin Smith

    I am trying to create a metric to report on # of tickets with a specific tag.

    I am going to Manager > add metric > custom metric

    I am typing in SELECT IFNULL((SELECT ... and then going to the right hand side and selecting Metrics > # tickets, but I am getting the following error message:

    Unexpected end of string. Expecting one of: ELEM_IDENTIFIER, FUNCNAME1, NEXT, OBJECT, STRING, -, RANKFUNCNAME, IF, PREVIOUS, FUNCNAMEN, COUNT, RUNFUNCNAME, NUMBER, IDENTIFIER, FUNCNAME2, CASE, FUNCNAME12, PERCENTILE, TEXT_ELEM, THIS, (
     
    Any input?
  • Avatar
    Amy Dee

    Hi Justin! It looks like you clicked "Add" on the lower right. That actually tries to add the metric to your report. It's the last button you should click, once everything else is complete.

    To add # Tickets (or any other element) to your report, you can double-click it in the list or click "Add Selected" on the top right. That should put the color-coded element in your metric and allow you to continue.

    Happy Reporting!

  • Avatar
    Justin Smith

    @Amy - that worked! Thanks so much!

  • Avatar
    Travis Smith

    I'm trying the same thing Sean mentioned earlier, creating a metric for tickets with two specific tags. I used the steps Joseph lists and I'm returning no results. Has anyone verified how to do this?

  • Avatar
    Amy Dee

    Hi Travis! Those steps should work. We've also updated this article since those comments were posted. There are screenshots above showing very similar metric recipes.

    There are a lot of moving parts in a recipe like this. The results also depend on your account's data. I'm going to start up a ticket for you, so we can take a closer look at your report so far.

    Watch for my email, and happy reporting!

  • Avatar
    Sophie Fitzpatrick

    Hey guys,

    I wondered whether you could help with something I'm really struggling with or even if you can tell me whether it's possible using Insights at all (we're on the Professional plan).

    I would like to be able to report on FRT (business hours) by tag.

    Some of our incoming tickets are auto-tagged with 'subscribed' upon entering Zendesk - ideally we'd like to see that these tickets are being answered more quickly than tickets without a tag (so the FRT would be lower).

    Logically I would have thought you'd be able to select the pre-made FRT (business hours) metric in the WHAT, select the time scale in the HOW and then FILTER by tag. However, this doesn't seem to work like that. I couldn't see to create what I'm after using the metrics already set up, so I built out some custom metrics.

    The standard metric (First Reply Time (hrs) [Mdn]) that is already built into Insights has this SQL:

    SELECT MEDIAN(First reply time in minutes/60) WHERE Ticket Status <> Deleted

    I tried to create custom FRT metrics for tickets where the tag was 'subscribed' and for tickets where the tag was not 'subscribed' i.e. no tag. As below:

    SELECT MEDIAN(First reply time in minutes within business hours/60)WHERE Ticket Tag = subscribed

    AND

    SELECT MEDIAN(First reply time in minutes within business hours/60) WHERE Ticket Tag <> subscribed

    I then set up a report with:

    WHAT - the two custom metrics above

    HOW - Date (Ticket Created)

    FILTER - Date (Ticket Created) is the last 11 days

    I did a controlled day where I responded to the tickets with the 'subscribed' tag in under an hour and responded to the tickets without a tag in over 2 hours.

    The results however were identical for each metric and seemed to draw on the FRT metric without the 'subscribed' tag. You can see this on the date of the 3.3.2017.

    Does anyone have any suggestions as to how I can get around this issue. It's creating a fairly large blockage in our work. If it's not possible at all in Insights, even that would be great to know so we can start exploring other methods and tools.

    Best

    Sophie

  • Avatar
    Amy Dee

    Hi Sophie! Ticket tags are not like other attributes. You can have any number of tags on a ticket at the same time, and you may need to report on any one of them. To make that possible, tag data is stored in a separate dataset.

    This means you need to take special steps to use tags in a report. You need to use a metric that connects to the tag dataset, and you need to construct filters that work with that metric. The First reply time metrics do not have any connection to tag data on their own, so they will ignore all tag filters.

    The article above goes into the theory behind tag reporting, and it shows some examples of metrics that do and do not connect to tag data. It also includes a recipe section describing how to build tag filtering metrics.

    Go through the recipe section once again, and try to build the metrics from the example report. That should give you a better idea of how the pieces fit together, which should help you fine tune the results for your use case.

    I hope this helps! Happy reporting!

  • Avatar
    Linda

    • SELECT COUNT(Ticket IdTicketTagId) WHERE Ticket Status <> Deleted AND Ticket Tag Deleted Flag <> true

    I use the fiter "ticket tag" and It did not work

  • Avatar
    Amy Dee

    Hi Linda! Tags are not like other attributes. For other attributes, tickets can only have one value at a time. It's easy to see whether a ticket is in, say, Pending status -- the ticket only has one status, and it either is or isn't "Pending."

    Tags are different. Tickets can have any number of tags at the same time. That makes things quite a bit more complicated. A ticket may have one of the tags from your filter, but not another. There are lot of ways to handle those situations, and Insights doesn't know which one you need.

    Because of all this, ticket tags do not consistently work in a dashboard filter like the one in your screenshot. Every single report would need to have metrics that accurately connect to tag data, and even then, there would be a lot of exceptions.

    We do not recommend putting a tag filter on a dashboard. If you want to use tags, you must use custom tag filtering metrics within your reports. Please follow the recipe above to filter your reports.

    I hope this helps! Happy reporting!

  • Avatar
    Charlee-Louise Molnar

    Hi Everyone, I am trying to create a metric to be able to report on tags. I have followed the above steps however when I go to add 'your_tag' in some of the Tags aren't there, I created them earlier today and can select them in tickets.

    Any help would be great. Thanks Charlee

  • Avatar
    Amy Dee (Edited )

    Hi Charlee-Louise! Have you used the tags on any of your tickets in Zendesk? Insights populates tag data based on how tags are used in tickets. If a tag hasn't been applied to any tickets, Insights can't see it.

    Once you use the tag on a ticket, that ticket needs to sync to GoodData. On Professional plans, data syncs once per day. On Enterprise plans, it syncs every hour or so. Zendesk changes don't appear immediately in Insights, but they should show up after the next sync.

    I hope this helps! Happy reporting!

  • Avatar
    Paul Wanless

    Hi Amy - This is great. I was wondering if this could be modified to get the number of tickets for a specific tag but if no tag was present it would be defined as 0. 

    I'm trying to see how many agents had a ticket with a specific tag for tickets they solved but if they did not have any tickets with that tag, then it would show the agent had 0 number of tickets. 

  • Avatar
    George Kaloyanov

    @Paul,

     

    If you want to do it just visually in the reports simply add this to your existing metric formatting: "[=null]0"

    If you want to use that 0 in further calculations then wrap-up the metric itself using the following that has been working for me:
    "SELECT IFNULL(Your Metric Here, 0)"

  • Avatar
    Paul Wanless

    Thanks @George

    That still has the limitation for me at least for my application as it was just a simple # Ticket metric that was just using the Filter to remove ticket that had two different tags.

    Even with the IFNULL statement, it would still never show the Agent Name being 0 because the tickets are filtered out.

    So I get a table like this with my what being "# Tickets" and How being "Ticket Assignee" with tags filtered

    These are and example of the results with that setup for a team of five agents I getting basically.

     

    Agent #2     1

    Agent #3     2

    Agent #4     4 

     

    What I'm looking for and trying to figure out is 

    Agent #1     0

    Agent #2     1

    Agent #3     2

    Agent #4     4 

    Agent #5     0

  • Avatar
    Amy Dee

    Hi Paul! Try adding *1 to the end of your metric:

    • SELECT IFNULL((SELECT # Tickets WHERE Ticket Tag = your_tag), 0)*1

    This can "trick" GoodData into treating the 0 as a real number, instead of a null value replacement. I tried this metric in a test account, and it showed me results very similar to your example.

    Please note, this trick only works when the report has one attribute under HOW. If you add more attributes, GoodData starts leaving cells blank again.

    I hope this helps! Happy reporting!

  • Avatar
    Sergei Kuznetsov

    Hi there! I was wondering if you could help me out on this one. I am currently trying to create a metric to measure the amount of tickets for VIP and Non-VIP catergories that were closed with a macros and custom reply. However for some reason the numbers on the custom tag vs the macro tag end up being the same.

    For example, I am using the following metric for the custom non-vip tickets

     
    and
     
     
    Any ideas on what I am doing wrong here?)
     
     
  • Avatar
    Vijayendra

    Since reporting with tags work only for specific metrics, how would I know if the metric that I want to create (or create) and break down using tags will give me the correct results or not?

    I am looking at average touches, Biz hrs 1st reply Avg time, Satisfaction %age, Reopen %age by tag for each customer segment.

  • Avatar
    Amy Dee

    Hi Vijayendra! Tag data is connected through the TicketTagId attribute, which is linked to Ticket Id. If that attribute connection is not in the metric, the metric won't recognize ticket tags.

    You don't need to customize all your metrics to include tag data. That would take a lot of extra work, and there are a lot of places where it could go wrong.

    Instead, create tag filtering metrics using the # Tickets metric (which does connect to ticket tags), then use those metrics to filter your report. As long as you're reporting on tickets by ticket ID, the filtering metrics should work.

    I hope this helps! Happy reporting!

  • Avatar
    Jill Gala

    Hi,

    I am trying to create a custom metric which basically connects #Unsatisfied with a particular Ticket Tag. They are not directly connected. I do not understand how I should connect them with Ticket TagID or Ticket ID.

    Any help is appreciated.

    Thanks.

     

  • Avatar
    Justin Smith

    Hey Jill. Try this:

     

    SELECT # Unsatisfied WHERE Ticket Tag = your_tag_goes_here

  • Avatar
    Amy Dee

    Hi Jill! Hi Justin!

    The default satisfaction metrics do not connect to ticket tags, so they will ignore Ticket Tag. Satisfaction data is pretty far from ticket tag data in the data model, so it would be very difficult to link them directly within one metric.

    Instead, you'll need to create a tag filtering metric based on the # Tickets metric. # Tickets is connected to tag data, so it does respect tag filters.

    Once you have a tag filtering metric, you can use that whole metric to filter your satisfaction report. As long as everything is based on ticket data, it should work.

    There are examples and specific steps in the recipe section above.

    I hope this helps! Happy reporting!

  • Avatar
    Fanny Sahlstrom

    Hi Amy! I am trying to create a new metric. I have followed the instructions of this article but I get an error message. Please see the screenshot. Can you see what I have done wrong?

Please sign in to leave a comment.

Powered by Zendesk