Hi, I am not sure exactly what you want to achieve, but the following query will give you a sum of all changes to to all accounts (including Assets and Liabilities) over the period of time
SELECT account, SUM(position) WHERE date >=2024-09-12 and date <=2024-09-26 This will be all of your incomes, all expenses over the period, as well as changes to Assets and Liabilities over the same period. Total will be 0. On Friday, September 20, 2024 at 6:30:29 PM UTC+2 Oscar & Alejandra wrote: > Hello everyone, > > I am using the latest beanquery from PyPI (v0.1.dev0) and I'm pretty new > to SQL and beanquery's SQL-like syntax. I am trying to produce a report > where I can see all of my expenses for a certain period, something like > what my bank statement would show but grouped by my expense categories. I > found this in the examples in the docs and it's pretty close to what I want > but I'm not sure how to grab the 'transfers' from my asset account. For > example when I make a payment towards my credit card or when I transfer > into my savings. > > FROM OPEN ON 2024-09-12 CLOSE ON 2024-09-26 > SELECT account, SUM(position) > WHERE account~"Income|Expenses" > GROUP BY 1 > ORDER BY 1 > > The above query produces something like the following: > > ----------------------------------- ------------ > account SUM(position > Expenses:Auto:Fuel 50.00 USD > Expenses:Auto:Insurance 140.00 USD > Expenses:Clothes 20.00 USD > Expenses:Debt:Interest 83.00 USD > Expenses:Food:Dining 100.00 USD > Expenses:Food:Groceries 140.00 USD > Expenses:Home:Utilities:Electricity 80.00 USD > Expenses:Home:Utilities:Water 70.00 USD > Income:Salary -3000.00 USD > > Where I would really like something like this > > ----------------------------------- ------------ > account SUM(position > Expenses:Auto:Fuel 50.00 USD > Expenses:Auto:Insurance 140.00 USD > Expenses:Clothes 20.00 USD > Expenses:Debt:Interest 83.00 USD > Expenses:Food:Dining 100.00 USD > Expenses:Food:Groceries 140.00 USD > Expenses:Home:Utilities:Electricity 80.00 USD > Expenses:Home:Utilities:Water 70.00 USD > Income:Salary -3000.00 USD > Liabilities:CreditCard 100.00 USD > Assets:Savings 300.00 USD > > Which would essentially show everything my 'paycheck' was spent on for the > period selected. Is this possible using beanquery? > > Thanks! > > > Oscar & Ale > > [email protected] > > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/32363a8a-d08e-4554-9941-b8ac89947a18n%40googlegroups.com.
