Multiple conditions on tags for standard calculated metrics | The place for Zendesk users to come together and share
Skip to main content
CharlieDM
May 13, 2026 11:33 PM UTC
Question

Multiple conditions on tags for standard calculated metrics

Hello everyone, 

I am trying to create a metrics that gives me all the ticket ID that verify both conditions: 

  • Not include either tags "Y" and "Z" (so exclude all tickets that have both Y and Z and tickets that have Y or Z)
  • Includes any of the tags "A" and "B"

I have tried

IF (NOT INCLUDES_ALL([Ticket tags], "Y", "Z") 
AND INCLUDES_ANY([Ticket tags], "A", "B"))
THEN [Ticket ID]
ENDIF

As well as 

IF (NOT INCLUDES_ANY([Ticket tags], "Y", "Z") 
AND INCLUDES_ANY([Ticket tags], "A", "B"))
THEN [Ticket ID]
ENDIF

In both of them I still have tickets that have either tag “Y” or tag “Z”. 

The “NOT INCLUDES_ALL” has a lot more results than the “NOT INCLUDES_ANY”. 

Any help appreciated since the Zendesk Bot only gives me back the NOT INCLUDES_ANY any solution however I rephrase or adjust my request. 

Cheers!

4 replies

dsniegocki
Newcomer
Oct 12, 2026 12:41 PM UTC

Hi Charlie, your second formula is the right logic. NOT INCLUDES_ALL only throws out tickets that have both Y and Z, so anything with just one of them slips through, which is why that version returns way more.

If the INCLUDES_ANY version still seems to show Y or Z tickets, check two things:

1. Is Ticket tags in your rows or columns? If so, each ticket gets split into one row per tag, and it looks like Y/Z tickets are in there even when the formula is doing its job. Take it out and use Ticket ID in the rows instead
2. Try it as a standard calculated attribute rather than a metric:

IF (INCLUDES_ANY([Ticket tags], "a", "b") AND NOT INCLUDES_ANY([Ticket tags], "y", "z")) THEN "Keep" ELSE "Drop" ENDIF

Then filter the report on that attribute = Keep and count tickets with whatever metric you normally use. Much easier to sanity check.

 

Hope that helps!!

Translate
Technical Director at Klick-Zen Buttons for Zendesk • www.klick-zen.com
Nov 8, 2026 9:23 PM UTC

You may want to check the logic by separating the exclusion and inclusion conditions. NOT INCLUDES_ANY should exclude tickets containing either Y or Z, while INCLUDES_ANY should match tickets containing at least one of A or B.

Your second formula looks logically correct. If you're still getting unexpected results, check whether the Ticket tags field contains multiple values or whether the report's filters are affecting the results. Testing each condition separately may help identify where the issue is occurring.

Hope this helps!

Translate
yconvert
Newcomer
Nov 15, 2026 1:06 PM UTC

dsniegocki’s calculated attribute plus filter idea is the cleanest path, and there is one small gotcha worth checking if Y or Z tickets still slip through. Explore’s INCLUDES_ANY and INCLUDES_ALL are case-sensitive, so a tag stored as “y” by an automation or import will not be caught by a check on “Y”, and mixed-case tagging is common enough to explain the leak you are seeing. The quickest fix is to wrap the tag list in LOWER (or UPPERCASE) and compare against lowercase values, for example NOT INCLUDES_ANY(LOWER([Ticket tags]), “y”, “z”), and that alone usually makes the exclusion behave. Keep Ticket ID in the rows and drop Ticket tags from them, since having the tags field in the report splits one ticket into multiple rows and makes the exclusion look broken even when the formula is correct.

Translate
yconvert
Newcomer
Nov 15, 2026 1:07 PM UTC

. Accidental duplicate of my reply above — please ignore this one.

Translate