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

dawehner’s picture

The sql standard afaik says: A field in sql can be either part of the groupby or part of an aggregate function like count()

Anonymous’s picture

OK but why would there need to be Group Settings for filters, sorts and relationships?

dawehner’s picture

An example for filters:

* Display all users with more then 10 nodes.

merlinofchaos’s picture

We 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?

bojanz’s picture

Would 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.

merlinofchaos’s picture

ah yeah, those can probably be eliminated.

dawehner’s picture

Sort by aggregation functions is a great feature.

This should probably wait once the icon for the groupby is provided again.

dawehner’s picture

Oh perhaps the icon will just use some css.

dawehner’s picture

StatusFileSize
new1013 bytes

Just a general patch.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new43.57 KB
new26.33 KB
new4.51 KB

This patch renames groupby to aggregate where i think it makes sense.

Additiona removes the settings from relationships.

merlinofchaos’s picture

Status: Needs review » Fixed

I approve.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.