I've gotten this to work:
- Code: Select all
SELECT "year", "month", "payee", SUM( "amount" ) FROM "alldata" WHERE ( "category" = 'Food' AND "subcategory" = 'Groceries' ) GROUP BY "year", "month", "payee" ORDER BY "year", "month", "payee"
Which makes a table with columns "Year" "Month" "Payee" and "Amount" (which is the total for each payee in a given month), but that is not helpful for making a chart because there are multiple rows for each month (one for each payee). I need to get the total for the payees into columns with 1 row for each month to make the Data Series for the chart.
What I'd really like is something where I have the following:
"Year" "Month" "Monthly sum for payee1 and payee2" "Monthly sum for payee3 and 4" "Monthly sum for payee5" etc... so I can easily make the graph in OOO. Can anyone help me with this? Is this even possible? Thanks!
