I've been filtering out nodes that share the same node reference via a custom module and hook_views_pre_render but while this works, it doesn't seem particularly elegant.
So I started looking at the new grouping feature in 3.x. I've read this issue #1043772: Setting 'Use grouping' to 'Yes' applies Group settings "cog" to every field, relationship, argument, sort, and filter but it didn't really clear things up.
What I'm struggling with is why "Group Settings" is added to filter criteria, sort criteria and relationships, rather than just the fields in a view? Also shouldn't there be a "Group Type > None" option in the Group Settings?
thanks
Comments
Comment #1
dawehnerThe sql standard afaik says: A field in sql can be either part of the groupby or part of an aggregate function like count()
Comment #2
Anonymous (not verified) commentedOK but why would there need to be Group Settings for filters, sorts and relationships?
Comment #3
dawehnerAn example for filters:
* Display all users with more then 10 nodes.
Comment #4
merlinofchaos commentedWe need to do some documentation work ont his feature.
Plus, I've been thinking that we should rename it from "Grouping" to "Aggregation" and explain in the help text that it enables the GROUP BY portion of a query and will aggregate multiple records into one, grouping by unaggregated fields.
Thoughts?
Comment #5
bojanz commentedWould definitely help distinguish the SQL grouping VS the grouping at the style plugin level.
Though I admit I have no idea why we have (empty) grouping settings for things like sorts and relationships.
Comment #6
merlinofchaos commentedah yeah, those can probably be eliminated.
Comment #7
dawehnerSort by aggregation functions is a great feature.
This should probably wait once the icon for the groupby is provided again.
Comment #8
dawehnerOh perhaps the icon will just use some css.
Comment #9
dawehnerJust a general patch.
Comment #10
dawehnerThis patch renames groupby to aggregate where i think it makes sense.
Additiona removes the settings from relationships.
Comment #11
merlinofchaos commentedI approve.