Views table aggregation with counts per value of a field A person can log multiple cases: Case 1, Case 2, Case 3

a case can have multiple states: New, Active, Resolved

Using a views table I want to generate a view where each person has one row, and I can see how many new, Active and Resolved cases each has:

Person   | States 
Person 1 | New(1), Active(3), Resolved (13) 
Person 2 | New(5), Active(3), Resolved (1)


Or something like this:

Person   | New | Active | Resolved
Person 1 | 1   | 3      | 13
Person 2 | 5   | 3      | 1


With normal aggregation all I can achieve is:

Person   | Cases
Person 1 | 17
Person 2 | 9


Surely I am missing something?
Views_merge_rows module will save your day! Assuming that the States field is a list field.

1) In your aggregation enabled views with table display add a User:Name (Group results together), a States field (COUNT, Excluded from display) and again a States field (Group results together, Rewrite Results > Rewrite the output of this field: [field_states]  ([field_states_1])).

So you will get a list of users with states but with one row per node. Here is a screenshot:



2) Then, enable the views_merge_rows module. In you Merge rows settings do this:



So you get what you want!