With QGIS >=2.16, it is possible to use aggregates in expressions, such as sum, average... etc.
But when I use it to create a new virtual field using the field calculator, the newly created field value is null for all of the layer's entities.
Am I doing it wrong ? Or it is a bug ?
I tried to change the field type with no effect. Note that it works when you create a non-virtual field.