Reports - can't be able to count some specific data in metric in report

Hi, i was trying to create a metric type element inside Reports. and I want the total count of age in specific range. For example, I need to show total count of people who lie between the age of 10-20, then 20-30 and so on. But when i try to add the conditions then it was giving me the age of first person which it finds in the particular age group instead of total count.


Hey, if you want the total count you’ll need to aggregate your data with a sum function
https://docs.cortezaproject.org/corteza-docs/2023.9/integrator-guide/reporting/expr-reference.html#_aggregation

The metric only expects one value as an input, the load you have gives multiple results (all records that match the filter). Thats why metrics should be used with an aggregated datasource.

I’m also trying to do a sum for a report. I figured out the sum part, but the Aggregate data source forces a Group By. I don’t want it by grouped items, I want the total for all the prefiltered rows.

Never mind, I figured it out. I can group by moduleID