Hello all,

I'm generating a campaign finance report, which means I need to load any 
journal entries for accounts whose *total balance* exceeds $50.00

I figure this is not going to be possible via BQL directly but figured it 
cannot hurt to ask.

The query I would love to use is something along the lines of:

```
  SELECT
    account,
    date,
    position,
    getitem(open_meta(account), 'pac_name') AS pac_name,
    getitem(open_meta(account), 'address') AS address,
    getitem(open_meta(account), 'city') AS city,
    getitem(open_meta(account), 'state') AS state,
    getitem(open_meta(account), 'zip') AS zip,
    getitem(open_meta(account), 'country') AS country,
    getitem(open_meta(account), 'email') AS email,
    getitem(open_meta(account), 'phone') AS phone
  WHERE account ~ 'Income:Contributions'
  AND getitem(open_meta(account), 'pac_name') != ''
  AND account IN (
    SELECT account
    WHERE abs(sum(position)) > 50
  )
  ORDER BY date
```

This doesn't appear to work and I believe that is because subqueries are 
not actually a thing in BQL.  Are there any query tools that might help be 
achieve this goal?

Best,
 - Dan

-- 
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 visit 
https://groups.google.com/d/msgid/beancount/1a6a706f-c95c-4e5b-a607-5c94c3d43325n%40googlegroups.com.

Reply via email to