Fava Query/Dashboard of Queries

106 views
Skip to first unread message

Tim Tickner

unread,
Dec 26, 2025, 1:13:14 PM12/26/25
to Beancount

Hi all, I have a number of queries saved in my ledger. They show up on the left-hand side of my Fava window under the query section (limited to 5 by default, but I know I can see more if I change the setting). I am looking for a way in Fava to see a table of my queries, a query of queries if you will. Basically, if I filter my full journal to only include Query from all time, that's what I want to see (but without having to click all the filter buttons on the journal header).


Maybe the answer is to use Fava dashboards, but my setup isn't mature enough to dive into that yet.


How would I see a dashboard/table of queries, which I could click on, to see the query results?


Thanks!

Tim

Paul Walker

unread,
Dec 26, 2025, 2:46:12 PM12/26/25
to Beancount
Not specific to queries, but could in theory work. I added html links in note directives on a special Equity:Links account:

2000-01-01 note Equity:Links "<a href=/ledger/account/Assets/?time=%28month-18%29+to+%28month%29&filter=%23Automatic>Automatic payments</a> - recurring, automatically-drafted transactions"

Which show up like this:

snip-2025-12-26_77709.png

Then I also have a standard sidebar link to those links:

3000-01-01 custom "fava-sidebar-link" "Links" "/ledger/journal/?account=Equity%3ALinks"

However it looks like queries also show up in the journal and are clickable, I just don't know how to filter. "flag:que" doesn't work. Using a magic date kinda works, but you'll need to exclude Open and X flags, which I don't know that you can do via query params anymore.

snip-2025-12-26_78055.png

Paul

redst...@gmail.com

unread,
Dec 26, 2025, 9:57:34 PM12/26/25
to Beancount

Github issue from the last decade that I filed :). I don’t have much web related knowledge, but it’s probably easy to do now with AI.

May not be what you're looking for, but a command-line alternate to execute queries: b q. It’d be trivial add a b q --list-all to it.

redst...@gmail.com

unread,
Dec 26, 2025, 10:19:06 PM12/26/25
to Beancount

Nice hack!

Minor limitations:

  • open only shows up accounts that were opened by plugins forme. Probably easily fixable
  • opening a query from this page retains the magic date
Still works well. Thanks for sharing!

Justin Steffen

unread,
Dec 26, 2025, 10:36:46 PM12/26/25
to bean...@googlegroups.com
I used Fava Dashboards and it’s relatively easy to setup. 

Would you share your queries for inspiration? :)

Thanks,
Justin

--
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 beancount+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/97a91777-5f72-4e54-918e-657ab115d2a9n%40googlegroups.com.

Paul Walker

unread,
Dec 30, 2025, 12:37:38 AM (12 days ago) 12/30/25
to Beancount
Fava Dashboards are nice. I like the sankey, but I don't have that much time to hack on them. My queries are mostly retirement planning and a little getting around Fava's emphasis on transaction-level filtering vs posting-level.

Roth Basis keeps track of Roth IRA contributions for early withdrawal. With investments under Assets:Investments, Assets:Liquid are checking/non-investments indicating Roth IRA contributions. Income:Earned is salary indicating Roth 401k contributions - filters out the gains/trades income as non withdrawable basis.

select year(date) as date, last(balance)
  from has_account('Assets:Liquid|Income:Earned')
  where account ~ 'Roth'
  group by date
  order by date desc

Bond Report aggregates custom meta (maturity, yield, coupon) from bonds' open directives so I can keep track of maturities and relative performance. This worked well because my importer could pull the information out of OFX transactions. Unfortunately institutions are systematically dropping OFX support. But e.g. https://github.com/pwalkr/beancount-utils/blob/wip/beancount_utils/importers/merrill_ofx.py#L164-L165

SELECT
  getitem(open_meta(account), 'maturity') as maturity,
  sum(convert(position, 'USD')) as balance,
  getitem(open_meta(account), 'yield') as rate,
  getitem(open_meta(account), 'coupon') as coupon,
  account
WHERE 'maturity' in open_meta(account) AND NOT close_date(account)
GROUP BY maturity, rate, coupon, account
ORDER BY maturity ASC

Tax Status is also based on open meta of tax-status:"Deferred" (Traditional IRAs), "Tax-Free" (Roth), or "Taxable" so I can keep track of how much I have in taxable funds for retirement income planning.

SELECT
  getitem(open_meta(account), 'tax-status') as tax,
  root(account, 2) as account,
  sum(convert(position, 'USD')) as balance
WHERE account ~ 'Assets:Investments' AND NOT close_date(account)
GROUP BY tax, account
ORDER BY balance DESC

Since my investments are at "Assets:Investments:<broker>:...", I can bump to root(account,3) to see which specific broker has which kinds of funds.

My other links/queries are mostly failing experiments in medical/insurance tracking. I'm torn between tagging #Deductible, #MOOP, and using intermediate (insurance) accounts.

Paul

On Friday, December 26, 2025 at 10:36:46 PM UTC-5 just...@gmail.com wrote:
I used Fava Dashboards and it’s relatively easy to setup. 

Would you share your queries for inspiration? :)

Thanks,
Justin

On Fri, Dec 26, 2025 at 2:46 PM Paul Walker <wpa...@gmail.com> wrote:
...

However it looks like queries also show up in the journal and are clickable, I just don't know how to filter. "flag:que" doesn't work. Using a magic date kinda works, but you'll need to exclude Open and X flags, which I don't know that you can do via query params anymore.

snip-2025-12-26_78055.png

Paul

Tim Tickner

unread,
Dec 30, 2025, 3:29:54 PM (11 days ago) 12/30/25
to Beancount
I don't have anything crazy, just some saved queries for tags like this:
2025-08-07 query "2025-bedroom-painting" "SELECT payee, narration, account, sum(position) WHERE '2025BedroomPainting' IN tags and account ~ 'Expense';"
and then some queries I'm planning to use to set up exports to Actual Budget (if I get that fully functional, I'll make a separate post):
2024-01-01 query "postings-Chase-Freedom" "select id, date, payee, narration, account, leaf(account) as category, position where 'Liabilities:Banking:Credit-Cards:Chase-Freedom' in other_accounts;"

I'm hoping to eventually replace Quicken; currently, I have a Jupyter notebook which process a Quicken CSV export and reformats it to an Actual-accepted format. I'd like to have that be a Beancount --> Actual flow.

Tim
Reply all
Reply to author
Forward
0 new messages