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

Have more questions? Submit a request

96 Comments

  • Amy Dee
    Comment actions Permalink

    Hi Taline! There are a couple issues with your approach. First, your first metric has this format - SELECT IFNULL((Tag Metric), 1). It should be a 0 at the end, not a 1. Otherwise, tickets with and without the tag will behave exactly the same way, which prevents it from filtering anything.

    Second, "ticket tag isn't" filters do not work in this context. That's because one ticket may have any number of tags at the same time, and all tickets have at least one tag record that isn't the tag you're looking for.

    Since you want to see tickets that have all three of the desired tags and not the undesired tag, you'll need to create four filtering metrics - SELECT IFNULL((SELECT # Tickets WHERE Ticket Tagtag_a),0). Then, you'll need to use numeric range filters to find tickets where the first three metrics are equal to 1 and the fourth metric is equal to 0.

    The Ticket Tag IN (listoftags) construction uses "ANY" logic. That means it only works if you want tickets with at least one of the listed tags or none of the listed tags. If you want all of the listed tags, you need to filter separately.

    I hope this helps! Happy reporting!

    0
  • Taline Moroyan
    Comment actions Permalink

    Hi Amy, 

    Thank you so much for following up on my comment! I have a few questions since not the best in writing such queries. 

    You mentioned that I would have to list out each tag for the custom metric. Would that then mean the query should look something like this? Tag_d being the undesired tag.

    SELECT IFNULL((SELECT # Tickets WHERE Ticket Tag = tag_a), 0) AND ((SELECT # Tickets WHERE Ticket Tag = tag_b),0) AND ((SELECT # Tickets WHERE Ticket Tag = tag_c),0) AND ((SELECT # Tickets WHERE Ticket Tag = tag_d),1)

    Also, the numeric range would be ... 

    Ticket ID  where Custom Metric Name is less than 1

    0
  • Amy Dee
    Comment actions Permalink

    Hi Taline! These all need to be separate metrics - 

    • SELECT IFNULL((SELECT # Tickets WHERE Ticket Tagtag_a),0)
    • SELECT IFNULL((SELECT # Tickets WHERE Ticket Tagtag_b),0)
    • SELECT IFNULL((SELECT # Tickets WHERE Ticket Tagtag_c),0)
    • SELECT IFNULL((SELECT # Tickets WHERE Ticket Tagtag_d),0)

    Each tag needs to be assessed separately, due to the way the data model is set up. Once you have all four metrics, you could combine them in a new metric:

    • SELECT IFNULL(( SELECT # Tickets WHERE (SELECT Tag A Metric BY Ticket Id) = 1 AND (SELECT Tag B Metric BY Ticket Id) = 1 AND (SELECT Tag C Metric BY Ticket Id) = 1 AND (SELECT Tag D Metric BY Ticket Id) = 0 ), 0)

    This finds tickets that ARE counted in the A, B, and C metrics, but NOT in the D metric. That means it only includes tickets with tags A, B, and C and not tag D. 

    From there you can put a numeric range on your report to find tickets where the combined metric is equal to 1.

    I hope this helps! Happy reporting!

    0
  • Taline Moroyan
    Comment actions Permalink

    Hi Amy!

    Thank you again for the insights here! I tried as suggested and it worked! Thank you so much!

     

    Taline

     

    0
  • Allen Montenegro
    Comment actions Permalink

    How do we get access to this page as Professional users?

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Hi Allen -

    I see that this is your first post. Welcome to the Zendesk Community!

    As far as your question goes, you should have access to perform all of the actions described in the article above the same as Enterprise users would. I'm not sure what page you're referring to though - could you clarify what you're looking for?

    0

Please sign in to leave a comment.

Powered by Zendesk