grouping categories and counting arrays

Hi all,

I am struggling to make the logic and need some help.

In querying all records, I would like to group categories and count eImpacts. In the example below I have the category "Visual arts"

The eImpact curiosity shows twice. I need to get the following object:

category: Visual arts

eImpacts: Joy, Curiosity, Inspiration, Satisfaction

Times: 1, 2, 1, 1

I tried to build to For Each Loop and group the query results withtout success.

Any input is welcome.

Cheers

Gustavo

12 replies