Error Code 5003 When Accessing Analytics Queries API

Hi Phill, the error you’re getting indicates that the total count of all possible elements to be returned is so high that it cannot be handled in one single query. There are some limits put intentionally in place with the aim of protecting performance and database stability. For example, when custom data is involved, the cardinality limit is 15000 elements, as you can read here: Configuration Guide

For customData field queries we allow a cardinality of maximum of 15,000 distinct values per customData field within the selected time-frame.

where limits apply to any field that is subject to have a high cardinality (number of elements) as well…so in order to reduce the cardinality (number of elements returned) of your query and have it work, it would be advisable to add as many filters as possible and to reduce the groupBy elements to the minimum possible. Regards