In my view, I'd like to group my row by values.

The initial data look like this.

enter image description here

In the field configuration in the view, I rewrite each value like this {{ field__value |split('-')[2] }} to get only the last part (CB, VISA...).

How do I group each row by the rewritten value? The idea would be to have this.

enter image description here

1 Answer 1


You can do this with Views Aggregator Plus. It does the aggregation after the views query so you can group by rewritten values. The readme indicates you should use "Global: Custom text" but I tried it with a rewritten value directly in a regular field and it works fine.

Once you install the module, add the field twice and rewrite as desired. Set your view format to "Table with aggregation options". Then in the table style options select "Apply group function" for both instances of the field. Set one to "Group and compress" and the other to "Count (having regexp) *". No parameters needed. This should give you what you are looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.