Count identical items in list by dividing into sublists


I have a node which lists all elements at level, and then an Element.GetCategory connected to it.
I’d like to be able to divide the elements into sublists by category so that I’ll be able to count the number of elements in each category. I haven’t been able to figure out the logic/nodes needed to achieve that.

I also have the Get Categories from Elements node, which lists categories only as unique items. I’m not sure if it will be useful here in getting to a solution.

If anyone can point me in the right direction that would be great.

you can use GroupByKeys Node, the list is the elements, the key from output of Element.GetCategory node

That was the first thing I tried. Unfortunately, the result was far from what I wanted.

convert the result from get category to string … it should work

That worked great, thank you!