Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi everybody,
I have a problem grouping a field which can be empty or with value. For example, I have a country node type, and it has a field named postal code which is not mandatory. I want to do a view with group by postal code option. If there are one or more nodes without postal code field, the view doesn't show the row of that field.
If you don't understand my explanation, please tell me and I'll explain again.
Thank you so much.
Comment | File | Size | Author |
---|---|---|---|
#5 | views_export.txt | 111.13 KB | Sinan Erdem |
Comments
Comment #1
luisortizramos CreditAttribution: luisortizramos commented+1
I have the same issue.
I have an Event with Title, Place and Days. Place is not mandatory and Days is a multiple date field.
If I order the view using this date field I get multiple rows for the same Event. So, I use the "Group by" options with "Tilte" and "Place" wondering if it will solve my problem and it does, but it generates a new one: when "Place" is empty it don't renders the row. Neither the view nor the SQL query it generates gets the data row.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedI think there is some confusion due to the naming in the UI.
There are two possible grouping settings. One is in the style settings on the left. One is under advanced settings on the right. Please specify which one you mean.
Attaching an export of the view might help as well.
Comment #3
luisortizramos CreditAttribution: luisortizramos commentedI'm using the agregation grouping option (under "Advanced options").
This is the view export:
Comment #4
dawehnerYou used the aggregate feature of views3, but you seems to want to have groupby on the styles level.
Comment #5
Sinan Erdem CreditAttribution: Sinan Erdem commentedI am grouping a table display by a field, and excluding that field from display. If there is no field under that grouped field, then that group is not displayed. I want it to be shown. I think this is what m3n0R asked in the first place.
I am attaching my view.