I would like to be able to group by multiple fields in my query.
In my query I set "by": ["Campaign Name", "Subject", "Bounce Type"],
However, whenever I do so I get the below error:
Length of ‘by’ must be <= 1
Based on the docs it appears that grouping by multiple fields is possible - if not can this be made available? It would prove extremely useful
Best answer by ben.liang
Hey @rpaul12 and @daniellanger ! We can probably add additional grouping fields to this endpoint, we wanted to start off small though in order to avoid extremely complex queries that may bog down our backend. Out of curiosity, how many additional groups would satisfy your respective use cases? @rpaul12 would you be able to make do with 2 group-by’s, or is your posted list of three a firm requirement for this to be useful for you?
Hey @rpaul12 and @daniellanger ! We can probably add additional grouping fields to this endpoint, we wanted to start off small though in order to avoid extremely complex queries that may bog down our backend. Out of curiosity, how many additional groups would satisfy your respective use cases? @rpaul12 would you be able to make do with 2 group-by’s, or is your posted list of three a firm requirement for this to be useful for you?
@ben.liang For our use case, we’d need to be able to breakdown the data by a flexible number. Right now, we are grabbing many properties from metrics from the v1/timeline endpoint and applying them as tags. These properties vary by metric, and grow based on customer requests. Therefore, having a hard limit is tough from an adoption POV. Maybe there is some “data response limit” where we maybe couldn’t request a full YEAR of data broken down by 5+ tags, but rather only a day at a time. Otherwise, we’ll have to continue using the timeline endpoint so we get full access to metadata. Does this make sense?