Merge rows settings are available under the OTHER section
Configuration dialog for rows merging

Sometimes when you use relationships in views you get a number of rows with the same content in some of the fields. This results in a huge table (grid, list, etc.) that affects the usability of your view.
The Views Merge Rows module provides a way to combine rows with the same content in the specified fields.

Installation and Configuration

After installing the module, enable it in Advanced Views settings. You then get the “Merge rows” item in the OTHER section of the Views UI:

Merge rows item

To configure the row merging, click the link next to the “Merge rows” item. The following configuration dialog shows up:

Merge rows configuration dialog

In this dialog, enabling/disabling row merging is controlled using the “Merge rows with the same content in the specified fields” checkbox.

When merging is enabled, the options shown for the available fields in the table are enforced. “Merge option” for each field is defined there. The available options are as described below.

For Drupal 7 version users

At this moment, no new D7 version is planned. Some of the options described below can be obtained through a patch or are simply not available for that Drupal version.

For Drupal 8 version users

If you use any of Drupal versions 8.0 to 8.3, you need the patches found in the following links to run the module. These changes were added to Drupal 8.4 feature requests. Currently, there is work done about this issue.

#2829046: Create public $DisplayPluginBase::getExtender($id)
#2824920: Make StylePluginBase::renderFields public
#2826755: Create a public read/write interface for $StylePluginBase::rendered_fields

If anyone can review these patch and set their status to "Reviewed and tested", it would be great. :)

Merge option Description
Use values of this field as a filter Checks which rows should be merged. If several rows contain exactly the same values in all of these fields, they are merged together.
Use the first value of this field Only the value from the first merged rows is used. The values in other rows are disregarded.
Merge values of this field All the values appears in the resulting row.
Merge unique values of this field The resulting row will contain unique values from the merged rows.
Count merged values of this field The resulting row will contain the counter of the merged rows.
Count merged unique values of this field The resulting row will contain the counter of the merged unique values.
Calculate the number of merged values minus the number of merged unique values of this field The resulting row will contain the difference between counter of the merged values and the counter of the merged unique values.
Use the highest value of this field The resulting row will contain the highest numerical value from the merged rows.
Use the lowest value of this field The resulting row will contain the highest numerical value from the merged rows.
Use the average value of this field The resulting row will contain the average value from the merged rows.
Use the sample standard deviation of this field The resulting row will contain the sample standard deviation value from the merged rows.
Sum values of this field The resulting row will contain the sum of values from the merged rows.

Project Information

Downloads