1. Retrieve the whole list from database.
2. For each enumeration value, add a Filter list operation to take records that match the value.
3. Count the filtered lists (7 lists in your case).
4. Use max function to take the highest count https://docs.mendix.com/refguide/mathematical-function-calls/#2-max
This approach only requires one database retrieval. Hope this helps.
Hi, I know your question has been answered already and there is nothing wrong with this approach. But do keep in mind that if you are working with large data tables you can run into problems by retrieving the full list. Maybe consider this approach.
Please view the images below as examples. It may look like overcomplicating things. But this method works great for large data sets if you really do have to count and display totals relating to your data.