function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
J PaulJ Paul 

Can I filter for more than one category from the same Data Category Group using the AND operator?

We have a Data Category Group called 'Locations'. I am hoping to write a SOQL query to find articles that have at least USA__c and Canada__c data category selections.

The documentation specifies how to use 'AND' to filter from two different groups but doesn't specify filtering from the same group. Is this possible with SOQL? 

Including both Locations in my query is giving an 'unexpected error':

SELECT Title, Id FROM Products__kav WITH DATA CATEGORY Locations__c AT USA__c AND Locations__c AT Canada__c

However including just one is working:

SELECT Title, Id FROM Products__kav WITH DATA CATEGORY Locations__c AT USA__c