Creating custom metrics in Explore to pull tickets with 2+ tags



  • Ryan Mumby

    Hey Maddi,

    From the query you're building select Calculations (calculator on the right), then choose Standard Calculated Metric.

    Try this formula

    IF([tag]="canada" AND [tag]="processed")
    THEN [Ticket ID]

    Drill into your data and do some spot checking by looking up a few randomly selected Ticket ID's to make sure it's grabbing tickets with the data you expect, but this should do the trick.

    Zendesk recently changed how they call out the the "Tags" attribute in their formulas though so I'm not 100% certain. They've moved from a model that called out Ticket, Org, User etc tags separately to 1 single "Tag" attribute, which is why I'm suggesting the checking to make sure its operating correctly.

  • Gab Guinto
    Zendesk Customer Care

    Hi Maddi,

    You can copy the formula that Ryan provided above. Thank you Ryan for this! :-)

    This should give you the data that you need on your query.


  • Maddi

    Copied the formula above and changed it to fit our tags (thanks Ryan!), but am getting this error:


    When I go into chart configuration, I get this: 

    Any insight on how to get the above formula working?

    From what I've read, Explore can't pull data using the 'AND' function.  Is this still the case, explaining why I can't pull data?  Is there any other way for us to pull data using metrics with 2+ tags?

  • Ryan Mumby

    Hey Maddi - I'm able to save the above just fine in my instance. I would say double check your syntax or repost a screenshot of the actual formula here for us to have a look and verify there are no errors in the formula, and if that's not working then you might have to contact support and report a bug. 

  • Riya

    I was coming across that error as well. It looks like `[tag]` needs to be replaced with `[Ticket tags]`

    I've found this other comment to be more helpful:

    Quoted (and modified) here:

    IF (([Ticket tags]="your_tag_name") AND ([Ticket tags]="your_tag_name_second") )THEN [Ticket ID] ENDIF

    replace your_tag_name and your_tag_name_second with the tags you want to search for.


Post is closed for comments.

Powered by Zendesk