Re: BQL: Exclude zero sum accounts

2022-01-21 Thread redst...@gmail.com
No way to currently do it AFAIK. A HAVING clause is on the wish list. See this comment . On Thursday, January 20, 2022 at 9:51:06 PM UTC-8 Maayaas wrote: > Hi, > > I am

Re: Opening, closing, then opening an account again

2022-01-21 Thread Aaron Lindsay
For whatever it's worth, I have encountered a similar situation a few times (sometimes with Expense accounts, sometimes with brokerage sub-accounts for specific investments which I close out a position but then buy it again at some later date). In each case, I shared the same hesitance about mod

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Maayaas
Thank you. It looks like I need to write a script to do this instead of searching for a BQL recipe. On Friday, January 21, 2022 at 1:38:10 AM UTC-8 redst...@gmail.com wrote: > No way to currently do it AFAIK. A HAVING clause > is on the wish l

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Daniele Nicolodi
On 21/01/2022 16:05, Maayaas wrote: Thank you. It looks like I need to write a script to do this instead of searching for a BQL recipe. You can easily write a script that post-processes the data returned by a BQL query. I often use Petl in combination with BQL for this. A simple example solv

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Daniele Nicolodi
On 21/01/2022 10:38, redst...@gmail.com wrote: No way to currently do it AFAIK. A HAVING clause is on the wish list. See this comment . Turns out that a naive implemen

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Martin Michlmayr
* Daniele Nicolodi [2022-01-21 22:51]: > Turns out that a naive implementation of HAVING was not very difficult to > put together https://github.com/beancount/beanquery/pull/22 Thank you, Daniele! I also asked about this feature in the past. -- Martin Michlmayr https://www.cyrius.com/ -- You

BQL value function does not respect closing date

2022-01-21 Thread David Handy
Hello, I am just getting started with bean-query, attempting to generate annual net worth reports. Here is my current query: SELECT getitem(open_meta(account), 'name') as name, value(sum(position)) AS balance FROM CLOSE ON 2021-01-01 CLEAR WHERE getitem(open_meta(account), 'report') = 'true'

Re: BQL value function does not respect closing date

2022-01-21 Thread David Handy
I figured this out via the 'help targets' command: 'VALUE(Position,date)': Convert a position to its cost currency at the market value of a particular date. Using value(sum(position), 2021-01-01) in my query returns the expected result. On Friday, January 21, 2022 at 5:45:53 PM UTC-8 David Han

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Martin Blais
That's great. On Fri, Jan 21, 2022 at 5:43 PM Martin Michlmayr wrote: > * Daniele Nicolodi [2022-01-21 22:51]: > > Turns out that a naive implementation of HAVING was not very difficult to > > put together https://github.com/beancount/beanquery/pull/22 > > Thank you, Daniele! I also asked ab

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Maayaas
Thanks Dan. Your script worked pretty well. On Friday, January 21, 2022 at 10:17:06 AM UTC-8 dan...@grinta.net wrote: > On 21/01/2022 16:05, Maayaas wrote: > > Thank you. It looks like I need to write a script to do this instead of > > searching for a BQL recipe. > > > You can easily write a s

Re: BQL: Exclude zero sum accounts

2022-01-21 Thread Maayaas
That's quite a feat, thanks! I am currently using beancount2 and fava (python3 -m pip install beancount fava). Is it possible to integrate this unreleased beanquery into this flow? On Friday, January 21, 2022 at 1:51:33 PM UTC-8 dan...@grinta.net wrote: > On 21/01/2022 10:38, redst...@gmail.com