Can anyone help me parse an aggregate function for Qgis 2.18 which sums the values of one field, for all entries which match a value of the entry in question.
So, for example if I have a simple layer with field "group", and "value", and entries are;
Group,Value 1,3 1,4 1,5 2,3 2,5 2,6
I want an expression which will yield "Group Total" such that,
Group,Value,Group Total 1,3,12 1,4,12 1,5,12 2,3,14 2,5,14 2,6,14
Next to all the entries in group 1 is the sum of all group 1, next to all the entries in group 2 is the sum of group 2
EDIT - I should add I've tried the most obvious sum("Value", "Group"), the predicted output in the expression calculator shows correct, but in the table the values are all just NULL, so I presume I'm doing something wrong.
EDIT2 - I should also have added that I'm looking for this function to automatically update somehow, in a virtual field, otherwise every time some value changes in my layer (and things do change!) all the totals will be wrong.