I have a field called payment_value for different customers i need to calculate the sum of payments for each customer , i can see ""use aggregation =Yes" at the view page but i dont know how to implement this option . thanks a lot.
I am not sure if you have already found the answer. I found this question from Google, so I am answering this so that somebody else might benefit.
When you are using Aggregation = Yes, remember one rule of thumb : All the fields that you are selecting must either use GROUP BY that field or some aggregation function on that field.
In your case you have two fields, User Name and Payment value. Once you enable the Aggregation, you will find
Aggregation settings beside your fields in Fields, Filter and Sort groups.
- For User Name - click on
Aggregation settingsand select "Group Results together".
- For Payment Value - click on
Aggregation settingsand select Aggregation type as SUM.
- In-spite of the above if your view is not using, then the culprits are sort and filters. Be careful about them. Removing them and adding them back one by one may be a easier solution.
- Remember that sorting is not necessary as GROUP BY does default sorting of groups. And more over if you add a sort it might add an additional GROUP BY, if your settings are not right.
If you're looking for one line per customer with the sum of their payments, then Views Group By is the module you're looking for. The release version only supports COUNT, the dev version supports SUM, MIN, MAX and AVG, too.