Hi all,
I'm having an issue with aggregation and i've not been able to find a good answer.I have a dataset that is made up off a number of collection of records. Something like id groupid value updatedOn 1 1 xx 19/01/2021 10:002 1 xx 19/01/2021 10:003 1 xx 19/01/2021 10:00
4 2 xx 10/01/2021 10:005 2 xx 10/01/2021 10:006 2 xx 01/01/2021 10:00
7 2 xx 01/02/2021 10:008 3 xx 01/02/2021 10:009 4 xx 01/02/2021 10:00I need to display the total responses grouped by the groupid each month, and display in a line graph.something likeMonth GroupCountJan 2Feb 1I was thinking aggregation but im not having much luck
Discussion posts and replies are publicly visible
I haven't tried this myself yet exactly, but I'd assume this is the sort of thing the newer "GroupingFunction" functionality in a!queryAggregationColumn() is for. Based on your provided column names, I'd expect maybe something like this might just work... and if not, it'd be useful to see what your exact code is, what your exact output is, and how it fails to meet your expected output.
a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "groupid", isGrouping: true() ), a!queryAggregationColumn( field: "updatedOn", isGrouping: true(), groupingFunction: "MONTH" ), a!queryAggregationColumn( field: "id", isGrouping: false(), aggregationFunction: "count", alias: "groupCount" ) } )