I have a Views table view that shows bank transactions. Each transaction has:
- A price field (which consists of a single positive OR negative amount)
- A date field
I would like to display the transactions grouped by month and then display a total of all the price fields for each month.
How can I do this?
Steps I have tried
1) Use Views built in tools
In the setting for a table view, you can chose to group entries by a field. So I group my fields by month.
I then go to
other > Use Aggregation and set it to
Finally I select
“Sum” in the aggregation options of the price field.
- Entries are grouped by month Months are not in order (It goes March, January, February, December)
- The total of the prices fields for each month is not displayed.
2) Use Views Calculation module
This requires a patch to support Group fields. Unfortunately, the patch does not work with price fields (see comment #118). My own testing confirms this.
3) Use Views Aggregator Plus
Views Aggregator Plus module is designed to be an alternative to Views Calc.
In Views format, I select a “Table with aggregation options” I apply the “column function” to my price field and select “sum” I apply the “group function” to my date field and select “group and compress”.
- Only the first transaction for each month is show (The other transactions are hidden)
- The total is displayed, but it is incorrect and doesn’t seem to relate to anything.