Given Channel entries, is there a way to get a list of unique entries in a text field and how many times that entry exist? For example, say the Channel contains the field first_name
(FT is text) and there are 100 entries. I need to know how that "John" exist 20 times, "Jill" exist 50 times, and "Jane" exist 30 times.
One possible solution is to nest looping through the channel entries and enabling PHP in the template in order to build the result I need. This seems inefficient. Another option is to probably use the Query module, but that requires knowing which fields the data exist in -- which becomes a maintenance issue when fields are deleted and re-added.
Suggestions?
field__id_x
would have changed. Seems like a maintenance nightmare.