IceTec described a problem combining --forecast and bal --budget.
Here's a repro:
; budget goal rules
~ monthly expenses budget
(expenses) 200
; forecast txn rules
~ monthly some expense
assets
expenses 100
--forecast uses all periodic rules in the period, including ones intended for setting budget goals:
$ hledger -f k.j --forecast reg expenses
2026-03-04 expenses budget (expenses) 200 200
2026-03-04 some expense expenses 100 300
2026-04-04 expenses budget (expenses) 200 500¯
2026-04-04 some expense expenses 100 600
2026-05-04 expenses budget (expenses) 200 800
2026-05-04 some expense expenses 100 900
2026-06-04 expenses budget (expenses) 200 1100
2026-06-04 some expense expenses 100 1200
2026-07-04 expenses budget (expenses) 200 1400
2026-07-04 some expense expenses 100 1500
2026-08-04 expenses budget (expenses) 200 1700
2026-08-04 some expense expenses 100 1800
I can exclude those here with not:desc:budget:
$ hledger -f k.j --forecast reg expenses not:desc:budget
2026-03-04 some expense expenses 100 100
2026-04-04 some expense expenses 100 200
2026-05-04 some expense expenses 100 300
2026-06-04 some expense expenses 100 400
2026-07-04 some expense expenses 100 500
2026-08-04 some expense expenses 100 600
but then they're excluded from bal --budget too, and no budget goals are shown.
$ hledger -f k.j --forecast bal -MN expenses not:desc:budget
Balance changes in 2026-03-01..2026-08-31:
|| Mar Apr May Jun Jul Aug
==========++==============================
expenses || 100 100 100 100 100 100
To work around, you have to (eg) move the budget rules into a separate file, then generate the forecast and do budget reporting in separate steps:
$ hledger -f k.j print --forecast | hledger -I -f- -f budget.j bal -MN expenses --budget
Budget performance in 2026-03-01..2026-08-31:
|| Mar Apr May Jun Jul Aug
==========++============================================================================================================
expenses || 100 [50% of 200] 100 [50% of 200] 100 [50% of 200] 100 [50% of 200] 100 [50% of 200] 100 [50% of 200]
How could we more precisely and intuitively exclude bal --budget's periodic rules from --forecast, or exclude bal --budget's generated goal transactions from reported amounts ?
IceTec described a problem combining --forecast and bal --budget.
Here's a repro:
--forecast uses all periodic rules in the period, including ones intended for setting budget goals:
I can exclude those here with
not:desc:budget:but then they're excluded from bal --budget too, and no budget goals are shown.
To work around, you have to (eg) move the budget rules into a separate file, then generate the forecast and do budget reporting in separate steps:
How could we more precisely and intuitively exclude bal --budget's periodic rules from --forecast, or exclude bal --budget's generated goal transactions from reported amounts ?