0

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!

2
  • Have you tried Aggregator plus Module? drupal.org/project/views_aggregator – Ismail Cherri Jan 31 '20 at 6:18
  • Unfortunately from what i'm seeing it doesn't work... Now i'm trying to do that with a computed field to use for this scope, let's see if this works – Francesco Jan 31 '20 at 10:19
0

I've not found a way to do this thing, but if any other needs something similar, i end up using Computed Field to handle this case, so i can store the actual field value normally, or another text (in my case 'Not filled').

Using this computed field instead of the actual field makes everything works...

But i'm open to change this thing if there's a better way to do this, as this sound a bit hacky...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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