We recently had a user ask how they could use the Average query macro to find the average number of Story cards in a series of Iterations.
The Average query macro is most often used to find the average of a numeric card property. As you can see in our Help Documentation, the query example finds the average size of all of the stories.
average query: SELECT size WHERE type = story
We found that the user could use the COUNT(*) aggregate property with a GROUP BY clause in order to find the average number of stories per iteration. The following query counts all of the story cards assigned to "IterationA" or "IterationB" and divides that number by the total number of iterations:
query: SELECT COUNT(*) WHERE type = Story AND Iteration = IterationA OR Iteration = IterationB GROUP BY Iteration