Skip to main content
removed "Drupal" and tags from the title
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

D7 Views aggregation Aggregation with count that includes empty field values

Source Link
Francesco
  • 133
  • 1
  • 7

D7 Views aggregation with count that includes empty field values

I saw other questions regarding the aggregation but i didn't found anything similar to what i need.
I've a view with enabled the aggregation, results are grouped by a field value (a text field) with also the count for that field. Everything is ok, but i'd like to include also the count for the empty values, and i can't make this thing to work...
Now i've something like

| FIELD VALUE | COUNT |  
|-------------|-------|  
| value 1     | 10    |  
| value 2     | 3     |  

And i'd like to have something like

| FIELD VALUE | COUNT |  
|-------------|-------|  
| value 1     | 10    |  
| value 2     | 3     |  
| -empty-     | 5     |  

Is there any way to achieve this? i tried writing something like "-empty-" in the no results behaviour, but the only thing i manage to have is a line with always the counter to 0, like

| FIELD VALUE | COUNT |
|-------------|-------|
| value 1     | 10    |
| value 2     | 3     |
| -empty-     | 0     |

I really don't know what to try now.. Thanks!