Discussion:
Transactions with different periods and budgeting
Joel Buckley
2018-04-20 02:26:57 UTC
Permalink
Hi,

I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.

Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have this
show up in the nice summary table that can be constructed, with a %
'completion' figure.

Minimal example:

;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking

~ every 3rd tue from 2018/04/07
expenses:movies $30

;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking

2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking

When I run $ hledger balance -M --budget -f ~/test.journal --cumulative
--show-unbudgeted I get the following:
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the -M
flag only looks at ~ monthly items, but I can't discover an invocation that
will show *all* of the budgets over my desired timeframe.

Thanks for any light that can be shed here,

Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 03:56:09 UTC
Permalink
Hi Joel, welcome.

This changed in hledger 1.9. See this very recent discussion: https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ <https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ>
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm enjoying it very much.
Today I looked into budgeting using hledger, and I am having some difficulty. I would like to use multiple periodic transactions of a differing basis (e.g. monthly, every third Tuesday, daily), and have this show up in the nice summary table that can be constructed, with a % 'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it doesn't get shown here like [ 101% of $800]is. I discovered that the -M flag only looks at ~ monthly items, but I can't discover an invocation that will show all of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joel Buckley
2018-04-20 05:41:01 UTC
Permalink
Ah, thanks for the link.

As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal --cumulative
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the -M
flag only looks at ~ monthly items, but I can't discover an invocation
that will show *all* of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 12:09:13 UTC
Permalink
You can! But we'd prefer not to add a switch if possible. And before it could happen, multi-interval budgets need more thought and coding work.

We need to specify, in detail, how reporting should work when budget and report have different intervals. Eg:

- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Post by Joel Buckley
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a command line switch, so that both our approaches are possible?
Hi Joel, welcome.
This changed in hledger 1.9. See this very recent discussion: https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ <https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ>
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm enjoying it very much.
Today I looked into budgeting using hledger, and I am having some difficulty. I would like to use multiple periodic transactions of a differing basis (e.g. monthly, every third Tuesday, daily), and have this show up in the nice summary table that can be constructed, with a % 'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it doesn't get shown here like [ 101% of $800]is. I discovered that the -M flag only looks at ~ monthly items, but I can't discover an invocation that will show all of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joel Buckley
2018-04-20 14:49:06 UTC
Permalink
So from reading the other thread yesterday (happy to carry on there if
you'd prefer), and wondering if I was using an incorrect paradigm in trying
to do budgeting today, I pondered something similar. Perhaps coming from a
place of naïvety given my relatively new familiarity with plain text
accounting, I would instinctively make the following observations:


- A budget on a macro time-scale can 'bundle up' all of the budgets on a
smaller or the same time-scales. So, if you're budgeting on a 'monthly'
time-scale ('monthly' meaning only that the unit of time is incremented by
one month — perhaps 3, 4 or 5 months are being inspected at any one time),
then you want to see an accounting for every periodic transaction that will
have been matched between the start and the end of the budget window (say
2018/02/01 – 2018/07/01). This could include events with regularity such as
daily, every third Tuesday, and every second month.
- Otherwise, in similar sorts of scenarios elsewhere, it's not
unreasonable to apportion figures in proportion to their degree. That is,
if I have a straightforward budget consisting only of monthly expenses, and
I choose to look at 3 days for a budget query, I simply divide those
budgeted monthly figures by the number of days in the month, and multiply
by 3 (the number of days I am examining). Perhaps from my inexperience, I
can't envisage a general use-case that isn't a user who has a normal array
of scheduled budgeting information (some monthly, some more esoteric), and
wants to look more granularly at his/her information, to the exclusion of
the broader picture.

So, in summary:
*Weekly report with a monthly budget:* divide budget items up by pro-rating
*Monthly report with a weekly budget:* add it up, simply as a longer-term
view of the weekly budget

How does that gel with your thoughts along these lines?
Post by Simon Michael
You can! But we'd prefer not to add a switch if possible. And before it
could happen, multi-interval budgets need more thought and coding work.
We need to specify, in detail, how reporting should work when budget and
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal --cumulative
|| 2017/11/30
2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of
$100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of
$800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of
0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the -M
flag only looks at ~ monthly items, but I can't discover an invocation
that will show *all* of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-20 15:37:58 UTC
Permalink
The problem with dividing is that it might not reflect the actual usage
pattern. For example: lets say I have a cup of coffee at work (usually) and
have a monthly budget for that. If generating daily report will divide
monthly budget by 30/31 days, this would be wrong, as I only drink coffee
on weekdays, but hledger will have no way to know that.

One, of course, can argue that in this case much better solution overall
will be to have daily budget for coffee for Mon-Fri, but it would be
cumbersome to define (you will need 5 separate budgets - one for Mon, Tue,
... each).

But I think this illustrates potential issues with dividing budgets.
Post by Joel Buckley
So from reading the other thread yesterday (happy to carry on there if
you'd prefer), and wondering if I was using an incorrect paradigm in trying
to do budgeting today, I pondered something similar. Perhaps coming from a
place of naïvety given my relatively new familiarity with plain text
- A budget on a macro time-scale can 'bundle up' all of the budgets on
a smaller or the same time-scales. So, if you're budgeting on a 'monthly'
time-scale ('monthly' meaning only that the unit of time is incremented by
one month — perhaps 3, 4 or 5 months are being inspected at any one time),
then you want to see an accounting for every periodic transaction that will
have been matched between the start and the end of the budget window (say
2018/02/01 – 2018/07/01). This could include events with regularity such as
daily, every third Tuesday, and every second month.
- Otherwise, in similar sorts of scenarios elsewhere, it's not
unreasonable to apportion figures in proportion to their degree. That is,
if I have a straightforward budget consisting only of monthly expenses, and
I choose to look at 3 days for a budget query, I simply divide those
budgeted monthly figures by the number of days in the month, and multiply
by 3 (the number of days I am examining). Perhaps from my inexperience, I
can't envisage a general use-case that isn't a user who has a normal array
of scheduled budgeting information (some monthly, some more esoteric), and
wants to look more granularly at his/her information, to the exclusion of
the broader picture.
*Weekly report with a monthly budget:* divide budget items up by pro-rating
*Monthly report with a weekly budget:* add it up, simply as a longer-term
view of the weekly budget
How does that gel with your thoughts along these lines?
Post by Simon Michael
You can! But we'd prefer not to add a switch if possible. And before it
could happen, multi-interval budgets need more thought and coding work.
We need to specify, in detail, how reporting should work when budget and
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal --cumulative
|| 2017/11/30
2017/12/31
======================++====================================
================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of
$100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of
$800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++------------------------------------
----------------
|| 0 [ 0% of 0] 0 [ 0% of
0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the
-M flag only looks at ~ monthly items, but I can't discover an
invocation that will show *all* of the budgets over my desired
timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google
Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 16:44:42 UTC
Permalink
Extending my jargon a little:
- single-interval vs multi-interval budgets
- single vs independent budget/report intervals

Currently we support single-interval budgets and a single matching budget and report interval. This is simple, predictable and good enough for simple budgeting. As a side bonus you can define multiple budgets (of different intervals) in a single file.

Independent budget/report intervals is required for multi-interval budgets, and might be useful with single-interval budgets too. It seems to imply 1. pro-rating long budgets down to short report intervals and 2. projecting short budgets out to long report intervals. While sensibly handling corner cases like:

3. budget and report bounds. There could be many different start/end dates in play.
4. non-aligned intervals. Week boundaries don't match exactly with month/quarter/year boundaries.
5. simple pro-rated/projected budget amounts not matching user intentions, as Dmitry said.

For 5, I imagine it would be fine to document the limitation and you could still get some value out of such approximate reports. But I'm just armchair designing, it's hard to know without more experience.

And perhaps there are other approaches we haven't considered yet.
The problem with dividing is that it might not reflect the actual usage pattern. For example: lets say I have a cup of coffee at work (usually) and have a monthly budget for that. If generating daily report will divide monthly budget by 30/31 days, this would be wrong, as I only drink coffee on weekdays, but hledger will have no way to know that.
One, of course, can argue that in this case much better solution overall will be to have daily budget for coffee for Mon-Fri, but it would be cumbersome to define (you will need 5 separate budgets - one for Mon, Tue, ... each).
But I think this illustrates potential issues with dividing budgets.
A budget on a macro time-scale can 'bundle up' all of the budgets on a smaller or the same time-scales. So, if you're budgeting on a 'monthly' time-scale ('monthly' meaning only that the unit of time is incremented by one month — perhaps 3, 4 or 5 months are being inspected at any one time), then you want to see an accounting for every periodic transaction that will have been matched between the start and the end of the budget window (say 2018/02/01 – 2018/07/01). This could include events with regularity such as daily, every third Tuesday, and every second month.
Otherwise, in similar sorts of scenarios elsewhere, it's not unreasonable to apportion figures in proportion to their degree. That is, if I have a straightforward budget consisting only of monthly expenses, and I choose to look at 3 days for a budget query, I simply divide those budgeted monthly figures by the number of days in the month, and multiply by 3 (the number of days I am examining). Perhaps from my inexperience, I can't envisage a general use-case that isn't a user who has a normal array of scheduled budgeting information (some monthly, some more esoteric), and wants to look more granularly at his/her information, to the exclusion of the broader picture.
Weekly report with a monthly budget: divide budget items up by pro-rating
Monthly report with a weekly budget: add it up, simply as a longer-term view of the weekly budget
How does that gel with your thoughts along these lines?
You can! But we'd prefer not to add a switch if possible. And before it could happen, multi-interval budgets need more thought and coding work.
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Post by Joel Buckley
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a command line switch, so that both our approaches are possible?
Hi Joel, welcome.
This changed in hledger 1.9. See this very recent discussion: https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ <https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ>
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm enjoying it very much.
Today I looked into budgeting using hledger, and I am having some difficulty. I would like to use multiple periodic transactions of a differing basis (e.g. monthly, every third Tuesday, daily), and have this show up in the nice summary table that can be constructed, with a % 'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it doesn't get shown here like [ 101% of $800]is. I discovered that the -M flag only looks at ~ monthly items, but I can't discover an invocation that will show all of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-20 16:50:28 UTC
Permalink
PS I meant to add: patches welcome. And let's not forget we can choose *not* to build this, if the actual need in practice does not merit the added complexity and maintenance cost. I haven't done enough budgeting yet myself to know how important these features are.
Post by Simon Michael
- single-interval vs multi-interval budgets
- single vs independent budget/report intervals
Currently we support single-interval budgets and a single matching budget and report interval. This is simple, predictable and good enough for simple budgeting. As a side bonus you can define multiple budgets (of different intervals) in a single file.
3. budget and report bounds. There could be many different start/end dates in play.
4. non-aligned intervals. Week boundaries don't match exactly with month/quarter/year boundaries.
5. simple pro-rated/projected budget amounts not matching user intentions, as Dmitry said.
For 5, I imagine it would be fine to document the limitation and you could still get some value out of such approximate reports. But I'm just armchair designing, it's hard to know without more experience.
And perhaps there are other approaches we haven't considered yet.
The problem with dividing is that it might not reflect the actual usage pattern. For example: lets say I have a cup of coffee at work (usually) and have a monthly budget for that. If generating daily report will divide monthly budget by 30/31 days, this would be wrong, as I only drink coffee on weekdays, but hledger will have no way to know that.
One, of course, can argue that in this case much better solution overall will be to have daily budget for coffee for Mon-Fri, but it would be cumbersome to define (you will need 5 separate budgets - one for Mon, Tue, ... each).
But I think this illustrates potential issues with dividing budgets.
A budget on a macro time-scale can 'bundle up' all of the budgets on a smaller or the same time-scales. So, if you're budgeting on a 'monthly' time-scale ('monthly' meaning only that the unit of time is incremented by one month — perhaps 3, 4 or 5 months are being inspected at any one time), then you want to see an accounting for every periodic transaction that will have been matched between the start and the end of the budget window (say 2018/02/01 – 2018/07/01). This could include events with regularity such as daily, every third Tuesday, and every second month.
Otherwise, in similar sorts of scenarios elsewhere, it's not unreasonable to apportion figures in proportion to their degree. That is, if I have a straightforward budget consisting only of monthly expenses, and I choose to look at 3 days for a budget query, I simply divide those budgeted monthly figures by the number of days in the month, and multiply by 3 (the number of days I am examining). Perhaps from my inexperience, I can't envisage a general use-case that isn't a user who has a normal array of scheduled budgeting information (some monthly, some more esoteric), and wants to look more granularly at his/her information, to the exclusion of the broader picture.
Weekly report with a monthly budget: divide budget items up by pro-rating
Monthly report with a weekly budget: add it up, simply as a longer-term view of the weekly budget
How does that gel with your thoughts along these lines?
You can! But we'd prefer not to add a switch if possible. And before it could happen, multi-interval budgets need more thought and coding work.
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Post by Joel Buckley
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a command line switch, so that both our approaches are possible?
Hi Joel, welcome.
This changed in hledger 1.9. See this very recent discussion: https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ <https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ>
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm enjoying it very much.
Today I looked into budgeting using hledger, and I am having some difficulty. I would like to use multiple periodic transactions of a differing basis (e.g. monthly, every third Tuesday, daily), and have this show up in the nice summary table that can be constructed, with a % 'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
|| 2017/11/30 2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of $100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of $800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of 0]
But even though an expense:movies budget is specified in the file, it doesn't get shown here like [ 101% of $800]is. I discovered that the -M flag only looks at ~ monthly items, but I can't discover an invocation that will show all of the budgets over my desired timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-20 23:58:52 UTC
Permalink
I cannot help but feel that we are looking at budgets from slightly
different perspectives. Let me elaborate a bit on mine.

I do not think about budgets as aggregate amounts or "envelopes" that you
fully or partially spend. I think about them as accruals representing
future transactions, and the real transactions would, at some point, offset
them. The closer they line up (both in terms of time and amounts), the
better would your planning and reporting be.

Using periodic transactions to represent these accruals is perfect, cause
they allow you to do model actual individual future transactions (if you
have enough data to set things up this way). If you cant or you don't want
to model actual individual future transactions, you could, of course, aim
for something coarser - like weekly or monthly aggregates. But they would
be just coarser future transactions, not "envelopes", created simply
because you do not want to be bothered with setting up something more
precise.

Then checking your balances becomes a simple act of offsetting these
accruals that you've set up earlier with actual transactions that really
happened. From this perspective, it makes perfect sense to just add up
balance transactions that occurred in any given period and compare them to
actual expenses that occur in the same period. There is already option to
carry forward unspent amounts across periods. This approach is strictly
more powerful than YNAB, in my opinion, as YNAB could be implemented in
this model easily.

If this comparison somehow does not make sense, then this is because your
budget does not really model your expenses close enough, it is probably too
coarse time-wise.

I think this point of view makes lots of things simpler. You do not need to
pro-rate and split budget transactions, at least not in an automatic way.
If there is a need to pro-rate to get better reports, then do it manually -
instead of a monthly budget set up weekly or bi-weekly or per-weekday
balances. You would know which alternative will make sense, the software
will not and I would claim that there is no one-size-fits-all solution here.

So from my perspective computations are already done the best possible way.
Potential gotchas could be solved by writing more docs/howtos/....

How do you think about budgets?
Post by Simon Michael
PS I meant to add: patches welcome. And let's not forget we can choose
*not* to build this, if the actual need in practice does not merit the
added complexity and maintenance cost. I haven't done enough budgeting yet
myself to know how important these features are.
- single-interval vs multi-interval budgets
- single vs independent budget/report intervals
Currently we support single-interval budgets and a single matching budget
and report interval. This is simple, predictable and good enough for simple
budgeting. As a side bonus you can define multiple budgets (of different
intervals) in a single file.
Independent budget/report intervals is required for multi-interval
budgets, and might be useful with single-interval budgets too. It seems to
imply 1. pro-rating long budgets down to short report intervals and 2.
projecting short budgets out to long report intervals. While sensibly
3. budget and report bounds. There could be many different start/end dates in play.
4. non-aligned intervals. Week boundaries don't match exactly with
month/quarter/year boundaries.
5. simple pro-rated/projected budget amounts not matching user intentions, as Dmitry said.
For 5, I imagine it would be fine to document the limitation and you could
still get some value out of such approximate reports. But I'm just armchair
designing, it's hard to know without more experience.
And perhaps there are other approaches we haven't considered yet.
The problem with dividing is that it might not reflect the actual usage
pattern. For example: lets say I have a cup of coffee at work (usually) and
have a monthly budget for that. If generating daily report will divide
monthly budget by 30/31 days, this would be wrong, as I only drink coffee
on weekdays, but hledger will have no way to know that.
One, of course, can argue that in this case much better solution overall
will be to have daily budget for coffee for Mon-Fri, but it would be
cumbersome to define (you will need 5 separate budgets - one for Mon, Tue,
... each).
But I think this illustrates potential issues with dividing budgets.
Post by Joel Buckley
So from reading the other thread yesterday (happy to carry on there if
you'd prefer), and wondering if I was using an incorrect paradigm in trying
to do budgeting today, I pondered something similar. Perhaps coming from a
place of naïvety given my relatively new familiarity with plain text
- A budget on a macro time-scale can 'bundle up' all of the budgets
on a smaller or the same time-scales. So, if you're budgeting on a
'monthly' time-scale ('monthly' meaning only that the unit of time is
incremented by one month — perhaps 3, 4 or 5 months are being inspected at
any one time), then you want to see an accounting for every periodic
transaction that will have been matched between the start and the end of
the budget window (say 2018/02/01 – 2018/07/01). This could include events
with regularity such as daily, every third Tuesday, and every second month.
- Otherwise, in similar sorts of scenarios elsewhere, it's not
unreasonable to apportion figures in proportion to their degree. That is,
if I have a straightforward budget consisting only of monthly expenses, and
I choose to look at 3 days for a budget query, I simply divide those
budgeted monthly figures by the number of days in the month, and multiply
by 3 (the number of days I am examining). Perhaps from my inexperience, I
can't envisage a general use-case that isn't a user who has a normal array
of scheduled budgeting information (some monthly, some more esoteric), and
wants to look more granularly at his/her information, to the exclusion of
the broader picture.
*Weekly report with a monthly budget:* divide budget items up by pro-rating
*Monthly report with a weekly budget:* add it up, simply as a
longer-term view of the weekly budget
How does that gel with your thoughts along these lines?
Post by Simon Michael
You can! But we'd prefer not to add a switch if possible. And before it
could happen, multi-interval budgets need more thought and coding work.
We need to specify, in detail, how reporting should work when budget and
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal
|| 2017/11/30
2017/12/31
======================++====================================
================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of
$100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of
$800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++------------------------------------
----------------
|| 0 [ 0% of 0] 0 [ 0% of
0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the
-M flag only looks at ~ monthly items, but I can't discover an
invocation that will show *all* of the budgets over my desired
timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-21 00:38:51 UTC
Permalink
I cannot help but feel that we are looking at budgets from slightly different perspectives. Let me elaborate a bit on mine.
I do not think about budgets as aggregate amounts or "envelopes" that you fully or partially spend. I think about them as accruals representing future transactions, and the real transactions would, at some point, offset them. The closer they line up (both in terms of time and amounts), the better would your planning and reporting be.
Using periodic transactions to represent these accruals is perfect, cause they allow you to do model actual individual future transactions (if you have enough data to set things up this way). If you cant or you don't want to model actual individual future transactions, you could, of course, aim for something coarser - like weekly or monthly aggregates. But they would be just coarser future transactions, not "envelopes", created simply because you do not want to be bothered with setting up something more precise.
Then checking your balances becomes a simple act of offsetting these accruals that you've set up earlier with actual transactions that really happened. From this perspective, it makes perfect sense to just add up balance transactions that occurred in any given period and compare them to actual expenses that occur in the same period. There is already option to carry forward unspent amounts across periods. This approach is strictly more powerful than YNAB, in my opinion, as YNAB could be implemented in this model easily.
If this comparison somehow does not make sense, then this is because your budget does not really model your expenses close enough, it is probably too coarse time-wise.
I think this point of view makes lots of things simpler. You do not need to pro-rate and split budget transactions, at least not in an automatic way. If there is a need to pro-rate to get better reports, then do it manually - instead of a monthly budget set up weekly or bi-weekly or per-weekday balances. You would know which alternative will make sense, the software will not and I would claim that there is no one-size-fits-all solution here.
That's for sure!

In this thread I'm speaking strictly about goal-based budgets (not envelope budgets with rollover etc.). You set change goals, you report actual changes compared to the goals. I think that's what you are talking about too.

So, are you saying the current implementation (single-interval budget, single budget/report interval) is good enough ?
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joel Buckley
2018-04-21 01:08:14 UTC
Permalink
Wow, that's certainly a level of precision I couldn't hope to achieve. Very
impressive. How do you account for whims/unexpected occurrences?

I think of budgets as strong guidance: part of an agreed schedule of what
it is acceptable to spend on items over a given time period (which may vary
per item/category — the crux of the issue for me). Perhaps this is most
similar to the envelope method. And I think of the differing regularity of
charges as differently-sized cogs in a watch, all spinning at different
frequencies but ultimately in there to add knowledge about the time (state
of my finances).

So regardless of what span of time I'm looking at when I run *hledger*, I'd
still like to know precisely what time it is (how much I've spent against
my target), and how far each of the cogs has moved (my previously agreed
constraints) will tell me that.

On submitting patches: I haven't done Haskell in years, but I could look at
it. Is there a resource on downloading and building from source, and
running unit tests? I'm on a mac, if that's any difference.
Post by Dmitry Astapov
I cannot help but feel that we are looking at budgets from slightly
different perspectives. Let me elaborate a bit on mine.
I do not think about budgets as aggregate amounts or "envelopes" that you
fully or partially spend. I think about them as accruals representing
future transactions, and the real transactions would, at some point, offset
them. The closer they line up (both in terms of time and amounts), the
better would your planning and reporting be.
Using periodic transactions to represent these accruals is perfect, cause
they allow you to do model actual individual future transactions (if you
have enough data to set things up this way). If you cant or you don't want
to model actual individual future transactions, you could, of course, aim
for something coarser - like weekly or monthly aggregates. But they would
be just coarser future transactions, not "envelopes", created simply
because you do not want to be bothered with setting up something more
precise.
Then checking your balances becomes a simple act of offsetting these
accruals that you've set up earlier with actual transactions that really
happened. From this perspective, it makes perfect sense to just add up
balance transactions that occurred in any given period and compare them to
actual expenses that occur in the same period. There is already option to
carry forward unspent amounts across periods. This approach is strictly
more powerful than YNAB, in my opinion, as YNAB could be implemented in
this model easily.
If this comparison somehow does not make sense, then this is because your
budget does not really model your expenses close enough, it is probably too
coarse time-wise.
I think this point of view makes lots of things simpler. You do not need
to pro-rate and split budget transactions, at least not in an automatic
way. If there is a need to pro-rate to get better reports, then do it
manually - instead of a monthly budget set up weekly or bi-weekly or
per-weekday balances. You would know which alternative will make sense, the
software will not and I would claim that there is no one-size-fits-all
solution here.
So from my perspective computations are already done the best possible
way. Potential gotchas could be solved by writing more docs/howtos/....
How do you think about budgets?
Post by Simon Michael
PS I meant to add: patches welcome. And let's not forget we can choose
*not* to build this, if the actual need in practice does not merit the
added complexity and maintenance cost. I haven't done enough budgeting yet
myself to know how important these features are.
- single-interval vs multi-interval budgets
- single vs independent budget/report intervals
Currently we support single-interval budgets and a single matching budget
and report interval. This is simple, predictable and good enough for simple
budgeting. As a side bonus you can define multiple budgets (of different
intervals) in a single file.
Independent budget/report intervals is required for multi-interval
budgets, and might be useful with single-interval budgets too. It seems to
imply 1. pro-rating long budgets down to short report intervals and 2.
projecting short budgets out to long report intervals. While sensibly
3. budget and report bounds. There could be many different start/end dates in play.
4. non-aligned intervals. Week boundaries don't match exactly with
month/quarter/year boundaries.
5. simple pro-rated/projected budget amounts not matching user
intentions, as Dmitry said.
For 5, I imagine it would be fine to document the limitation and you
could still get some value out of such approximate reports. But I'm just
armchair designing, it's hard to know without more experience.
And perhaps there are other approaches we haven't considered yet.
The problem with dividing is that it might not reflect the actual usage
pattern. For example: lets say I have a cup of coffee at work (usually) and
have a monthly budget for that. If generating daily report will divide
monthly budget by 30/31 days, this would be wrong, as I only drink coffee
on weekdays, but hledger will have no way to know that.
One, of course, can argue that in this case much better solution overall
will be to have daily budget for coffee for Mon-Fri, but it would be
cumbersome to define (you will need 5 separate budgets - one for Mon, Tue,
... each).
But I think this illustrates potential issues with dividing budgets.
Post by Joel Buckley
So from reading the other thread yesterday (happy to carry on there if
you'd prefer), and wondering if I was using an incorrect paradigm in trying
to do budgeting today, I pondered something similar. Perhaps coming from a
place of naïvety given my relatively new familiarity with plain text
- A budget on a macro time-scale can 'bundle up' all of the budgets
on a smaller or the same time-scales. So, if you're budgeting on a
'monthly' time-scale ('monthly' meaning only that the unit of time is
incremented by one month — perhaps 3, 4 or 5 months are being inspected at
any one time), then you want to see an accounting for every periodic
transaction that will have been matched between the start and the end of
the budget window (say 2018/02/01 – 2018/07/01). This could include events
with regularity such as daily, every third Tuesday, and every second month.
- Otherwise, in similar sorts of scenarios elsewhere, it's not
unreasonable to apportion figures in proportion to their degree. That is,
if I have a straightforward budget consisting only of monthly expenses, and
I choose to look at 3 days for a budget query, I simply divide those
budgeted monthly figures by the number of days in the month, and multiply
by 3 (the number of days I am examining). Perhaps from my inexperience, I
can't envisage a general use-case that isn't a user who has a normal array
of scheduled budgeting information (some monthly, some more esoteric), and
wants to look more granularly at his/her information, to the exclusion of
the broader picture.
*Weekly report with a monthly budget:* divide budget items up by pro-rating
*Monthly report with a weekly budget:* add it up, simply as a
longer-term view of the weekly budget
How does that gel with your thoughts along these lines?
Post by Simon Michael
You can! But we'd prefer not to add a switch if possible. And before it
could happen, multi-interval budgets need more thought and coding work.
We need to specify, in detail, how reporting should work when budget
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far
I'm enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal
|| 2017/11/30
2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of
$100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of
$800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of
0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the
-M flag only looks at ~ monthly items, but I can't discover an
invocation that will show *all* of the budgets over my desired
timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-21 03:15:10 UTC
Permalink
On submitting patches: I haven't done Haskell in years, but I could look at it. Is there a resource on downloading and building from source, and running unit tests? I'm on a mac, if that's any difference.
There are! :)

Let us know when you find roadblocks. The IRC channel can be faster.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-21 09:52:50 UTC
Permalink
Post by Simon Michael
So, are you saying the current implementation (single-interval budget,
single budget/report interval) is good enough ?
I did not realize that this changed in 1.9 (i am still using 1.5, as
upgrade usually involves some housekeeping work) :(

I just checked, and it looks that I will personally have to stick to 1.5
for the time being (or backport patches, or do budgeting outside of hledger
if i move to 1.9). I have forecast file which gradually becomes budget as
time moves on, and this simply does not work anymore. This file is a mix of
monthly, weekly, yearly, quarterly and one-off transactions, and if only a
subset of them is selected for balance --budget I get rather meaningless
reports :(
Post by Simon Michael
On submitting patches: I haven't done Haskell in years, but I could look
at it. Is there a resource on downloading and building from source, and
running unit tests? I'm on a mac, if that's any difference.
There are! :)
Let us know when you find roadblocks. The IRC channel can be faster.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-21 16:30:48 UTC
Permalink
I did not realize that this changed in 1.9 (i am still using 1.5, as upgrade usually involves some housekeeping work) :(
What sort of housekeeping work ? In my mind, hledger upgrades "just work".
I just checked, and it looks that I will personally have to stick to 1.5 for the time being (or backport patches, or do budgeting outside of hledger if i move to 1.9). I have forecast file which gradually becomes budget as time moves on, and this simply does not work anymore. This file is a mix of monthly, weekly, yearly, quarterly and one-off transactions, and if only a subset of them is selected for balance --budget I get rather meaningless reports :(
Oh oh. I was thinking you were in favour of this change. (I mentioned it before release but there wasn't much response, and I pushed it out under time pressure, trying to fill out the release.)

So, how does hledger 1.5 report your weekly budget amounts in a monthly report, and vice versa ?

I'm not sure I understand your scheme with forecasts becoming budget. Could you show us an example ?

I think 1.9's budget report has a bug with monthly column ordering, and the lack of complaints suggests nobody is using it yet. I'm expecting to do a minor release. Normally that would include only bugfixes but we could bend the rules to get more testing of budget changes before 2.0.

NOTE: if anyone gets inspired to work on budgeting, just now they should start from the "budget" branch, which has some WIP.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-21 22:08:07 UTC
Permalink
Post by Dmitry Astapov
I did not realize that this changed in 1.9 (i am still using 1.5, as
upgrade usually involves some housekeeping work) :(
What sort of housekeeping work ? In my mind, hledger upgrades "just work".
Oh, this is just something related to how I have set things up. Since i
regularly regenerate .journal files from tons of CSV files, it is not
uncommon to find that new version of hledger either prettyprints
transactions a bit differently, or changes balance/bs reports (which i
generate and version-control) or changes the order in which CSV importer
prints out transactions (happened during 1.4 upgrade, I think). When this
happens I browse through diffs in generated journals and my reports to see
that nothing else have changed. This usually take some time, i requires me
to have no other uncommited changes in my .journal files repo, so I have to
"get ready" to hledger upgrade (though quite often upgrade is indeed
completely uneventful).
Post by Dmitry Astapov
I just checked, and it looks that I will personally have to stick to 1.5
for the time being (or backport patches, or do budgeting outside of hledger
if i move to 1.9). I have forecast file which gradually becomes budget as
time moves on, and this simply does not work anymore. This file is a mix of
monthly, weekly, yearly, quarterly and one-off transactions, and if only a
subset of them is selected for balance --budget I get rather meaningless
reports :(
Oh oh. I was thinking you were in favour of this change. (I mentioned it
before release but there wasn't much response, and I pushed it out under
time pressure, trying to fill out the release.)
I went through the phase of "email bancruptcy" during Feb-Mar due to
personal circumstances and hardly read any email :(
Post by Dmitry Astapov
So, how does hledger 1.5 report your weekly budget amounts in a monthly
report, and vice versa ?
I'm not sure I understand your scheme with forecasts becoming budget.
Could you show us an example ?
Gladly! At the beginning of the year I will update my forecast file which
would list all regular incomes and expenses, as well as known one-off large
expenses that I plan for. Some income is predictable and every month, some
is less predictable and happens quarterly. Same with expenses. I am
attaching sample forecast.journal and here is how my forecast will look
Post by Dmitry Astapov
hledger -M bal -f forecast.journal -b 2017 -e 2017-07 --forecast
Balance changes in 2017/01/01-2017/06/30:

|| 2017/01 2017/02 2017/03 2017/04 2017/05
2017/06
===========================++======================================================
assets:current || £733 £540 £1440 £440 £400
£1540
expenses:bills || 0 £100 £100 £100 £100
£100
expenses:car:fuel || £50 £40 £40 £40 £50
£40
expenses:car:insurance || 0 0 0 0 0
£100
expenses:council tax || £100 0 0 £100 0
0
expenses:food:groceries || £50 £40 £40 £40 £50
£40
expenses:fun || 0 £100 0 £100 0
0
expenses:home:renovations || 0 0 £100 0 £100
0
expenses:misc || £51 £40 £40 £40 £50
£40
expenses:school || £100 0 £100 0 £100
0
expenses:tax office || £100 0 0 0 0
0
expenses:travel:commute || £50 £40 £40 £40 £50
£40
income:investments || 0 0 £-1000 0 0
£-1000
income:work || £-1234 £-1000 £-1000 £-1000 £-1000
£-1000
liabilities:mortgage || 0 £100 £100 £100 £100
£100
---------------------------++------------------------------------------------------
|| 0 0 0 0 0
0


Then I will start recording my transactions in a file that !include-s
forecast.journal. As I record more and more transactions, I can now treat
same pariodic transactions not as forecast, but as budget, against which i
will compare my actual finances. I've attached forecast-plus-actual.journal
that has a bunch of "real" transactions. Here is monthly balance report
Post by Dmitry Astapov
hledger -M bal -f forecast-plus-actual.journal -b 2017 -e 2017-07 --budget
Balance changes in 2017/01/01-2017/06/30:

|| 2017/01
2017/02 2017/03 2017/04
2017/05 2017/06
===========================++======================================================================================================================================================
assets:current || £2125 [139% of £1534] £1000 [185% of
£540] £1920 [133% of £1440] £901 [205% of £440] £900 [225% of
£400] £1970 [128% of £1540]
expenses:car:insurance || 0 [0% of 0] 0 [0% of
0] 0 [0% of 0] 0 [0% of 0] £100
[0] 0 [0% of £100]
expenses:council tax || £101 [101% of £100] 0 [0% of
0] 0 [0% of 0] £99 [99% of £100] 0 [0% of
0] 0 [0% of 0]
expenses:home:renovations || 0 [0% of 0] 0 [0% of
0] £90 [90% of £100] 0 [0% of 0] 0 [0% of
£100] 0 [0% of 0]
expenses:misc || £1 [2% of £50] 0 [0% of
£40] 0 [0% of £40] 0 [0% of £40] 0 [0% of
£50] 0 [0% of £40]
expenses:tax office || £101 [101% of £100] 0 [0% of
0] 0 [0% of 0] 0 [0% of 0] 0 [0% of
0] 0 [0% of 0]
expenses:travel:commute || £16 [32% of £50] 0 [0% of
£40] 0 [0% of £40] 0 [0% of £40] 0 [0% of
£50] 0 [0% of £40]
income:investments || 0 [0% of 0] 0 [0% of
0] £-1010 [101% of £-1000] 0 [0% of 0] 0 [0% of
0] £-970 [97% of £-1000]
income:work || £-2344 [105% of £-2234] £-1000 [100% of
£-1000] £-1000 [100% of £-1000] £-1000 [100% of £-1000] £-1000 [100% of
£-1000] £-1000 [100% of £-1000]
---------------------------++------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0
0 0 0
0 0

As you can see (in income:investments or expenses:council tax) quarterly
expenses are displayed quite nicely here, as well as weekly
(expenses:travel:commute)
or one-off (expenses:home:renovations).
I can see that home renovations took less than expected, investments
overperformed my estimate in Q1, but were less succesfull in Q2, and I can
see that I paid for car insurance month earlier than I planned.
Post by Dmitry Astapov
hledger -Q bal -f forecast-plus-actual.journal -b 2017 -e 2017-07 --budget
Balance changes in 2017/01/01-2017/06/30:

|| 2017q1
2017q2
===========================++==================================================
assets:current || £5045 [144% of £3514] £3771 [158% of
£2380]
expenses:car:insurance || 0 [0% of 0] £100 [100% of
£100]
expenses:council tax || £101 [101% of £100] £99 [99% of
£100]
expenses:home:renovations || £90 [90% of £100] 0 [0% of
£100]
expenses:misc || £1 [1% of £130] 0 [0% of
£130]
expenses:tax office || £101 [101% of £100] 0 [0% of
0]
expenses:travel:commute || £16 [12% of £130] 0 [0% of
£130]
income:investments || £-1010 [101% of £-1000] £-970 [97% of
£-1000]
income:work || £-4344 [103% of £-4234] £-3000 [100% of
£-3000]
---------------------------++--------------------------------------------------
|| 0
0

Same for weekly, early, or arbitrary period balance report with --budget:
transactions (real and budget) would be generated, aggregated, compared.

Now lets compare this to output from hledger-1.9:

Monthly
Post by Dmitry Astapov
hledger-1.9 -M bal -f forecast-plus-actual.journal -b 2017 -e 2017-07
--budget
Balance changes in 2017/01/01-2017/06/30:

|| Apr
Feb Jan Jun
Mar May
===========================++============================================================================================================================================================
assets:current || £901 £1000
£2125 £1970 £1920
£900
expenses:car:insurance || 0 0
0 0 0
£100
expenses:council tax || £99 0
£101 0 0
0
expenses:home:renovations || 0 0
0 0 £90
0
expenses:misc || 0 0
£1 0 0
0
expenses:tax office || 0 0
£101 0 0
0
expenses:travel:commute || 0 0
£16 0 0
0
income:investments || 0 0
0 £-970 £-1010
0
income:work || £-1000 £-1000
£-2344 £-1000 £-1000
£-1000
---------------------------++------------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0
0 0 0
0
Post by Dmitry Astapov
hledger-1.9 -Q bal -f forecast-plus-actual.journal -b 2017 -e 2017-07
--budget
Balance changes in 2017/01/01-2017/06/30:

|| 2017q1
2017q2
===========================++====================================================
assets:current || £5045 £3771

expenses:car:insurance || 0 £100

expenses:council tax || £101 £99

expenses:home:renovations || £90 0

expenses:misc || £1 0

expenses:tax office || £101 0

expenses:travel:commute || £16 0

income:investments || £-1010 £-970

income:work || £-4344 £-3000

---------------------------++----------------------------------------------------
|| 0 0

As you can see, I do not see any budget numbers at all with hledger-1.9 :(
Post by Dmitry Astapov
I think 1.9's budget report has a bug with monthly column ordering, and
the lack of complaints suggests nobody is using it yet. I'm expecting to do
a minor release. Normally that would include only bugfixes but we could
bend the rules to get more testing of budget changes before 2.0.
NOTE: if anyone gets inspired to work on budgeting, just now they should
start from the "budget" branch, which has some WIP.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-22 02:35:32 UTC
Permalink
This is very interesting, thanks for these details! I will study it.

One thing I can see right away is that 1.9's monthly budget report is indeed sorting columns alphabetically rather than chronologically - not very useful. I think a next priority is to merge https://github.com/simonmichael/hledger/pull/739 <https://github.com/simonmichael/hledger/pull/739>, fixing that; and finish implementing sort options.

And your empty -M and -Q budget reports are because of 1.9's simple-minded selecting of only the monthly and quarterly periodic transactions, which you have few of. (It looks like it should select the "every Xth MON" rules, but isn't.)

I'd still like to know how 1.5 handles differing budget and report interval. I commented out all but your first periodic txn, and looked at the monthly income:work budget.

In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.

In a weekly report, it's zero in most weeks, and the full monthly amount every so often. That's not bad, perhaps it would be more useful if it smoothed it out across all weeks, but right now it does make sense when you read it.

So based on your actual experience, this to be working reasonably well for you, and my concerns about the handling of different budget and report intervals are unnecessary. It's looking increasingly like the right thing to do is revert that part of my changes, and allow multi-interval budgets again, in 1.9.1.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-22 14:37:14 UTC
Permalink
Post by Simon Michael
This is very interesting, thanks for these details! I will study it.
One thing I can see right away is that 1.9's monthly budget report is
indeed sorting columns alphabetically rather than chronologically - not
very useful. I think a next priority is to merge https://github.com/
simonmichael/hledger/pull/739, fixing that; and finish implementing sort
options.
That pull request look really interesting and seems like it could open all
sorts of possibilities, like maybe comparing two budget reports against
each other (last year vs current year, or something similar).
Post by Simon Michael
And your empty -M and -Q budget reports are because of 1.9's simple-minded
selecting of only the monthly and quarterly periodic transactions, which
you have few of. (It looks like it should select the "every Xth MON" rules,
but isn't.)
I'd still like to know how 1.5 handles differing budget and report
interval. I commented out all but your first periodic txn, and looked at
the monthly income:work budget.
In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.
In a weekly report, it's zero in most weeks, and the full monthly amount
every so often. That's not bad, perhaps it would be more useful if it
smoothed it out across all weeks, but right now it does make sense when you
read it.
I would argue that "zero in most weeks and then full amount every so often"
matches actual behavior - after all, this is how salary will come in, once
per month with other weeks being "empty". If you smooth it out allocating
1/4th every week then it will look like 3 weeks out of four do not cosume
budget amount and then suddlenly next one goes 200% over the top, neither
of which is true. Same logic could be applied to quarterly transactions
and monthly balance report and so on
Post by Simon Michael
So based on your actual experience, this to be working reasonably well for
you, and my concerns about the handling of different budget and report
intervals are unnecessary. It's looking increasingly like the right thing
to do is revert that part of my changes, and allow multi-interval budgets
again, in 1.9.1.
I for one would be super happy if this happens :)
Post by Simon Michael
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Jouty
2018-04-22 15:14:44 UTC
Permalink
Post by Dmitry Astapov
Post by Simon Michael
This is very interesting, thanks for these details! I will study it.
One thing I can see right away is that 1.9's monthly budget report is
indeed sorting columns alphabetically rather than chronologically - not
very useful. I think a next priority is to merge
https://github.com/simonmichael/hledger/pull/739, fixing that; and
finish implementing sort options.
That pull request look really interesting and seems like it could open all
sorts of possibilities, like maybe comparing two budget reports against
each other (last year vs current year, or something similar).
Post by Simon Michael
And your empty -M and -Q budget reports are because of 1.9's
simple-minded selecting of only the monthly and quarterly periodic
transactions, which you have few of. (It looks like it should select the
"every Xth MON" rules, but isn't.)
I'd still like to know how 1.5 handles differing budget and report
interval. I commented out all but your first periodic txn, and looked at
the monthly income:work budget.
In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.
In a weekly report, it's zero in most weeks, and the full monthly amount
every so often. That's not bad, perhaps it would be more useful if it
smoothed it out across all weeks, but right now it does make sense when you
read it.
I would argue that "zero in most weeks and then full amount every so
often" matches actual behavior - after all, this is how salary will come
in, once per month with other weeks being "empty". If you smooth it out
allocating 1/4th every week then it will look like 3 weeks out of four do
not cosume budget amount and then suddlenly next one goes 200% over the
top, neither of which is true. Same logic could be applied to quarterly
transactions and monthly balance report and so on
Post by Simon Michael
So based on your actual experience, this to be working reasonably well
for you, and my concerns about the handling of different budget and report
intervals are unnecessary. It's looking increasingly like the right thing
to do is revert that part of my changes, and allow multi-interval budgets
again, in 1.9.1.
I for one would be super happy if this happens :)
Having finally gone through and understood what the discussion is about: I
am also in favor of reverting to the "1.5 behavior" (regarding multiple
periodicity forecast transactions).
I haven't set up my budgeting with hledger yet, but I would likely revert
to 1.5 before doing so, having now understood the differences.
Post by Dmitry Astapov
Post by Simon Michael
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jonathan Jouty
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-22 15:15:54 UTC
Permalink
Simon, I just built your "budget" branch with one-line change that could be
seen in (
https://github.com/simonmichael/hledger/compare/budget...adept:budget) and
I am happy camper again :) Display and formatting is better and cleaner,
and all the numbers seem to line up.
Post by Dmitry Astapov
Post by Simon Michael
This is very interesting, thanks for these details! I will study it.
One thing I can see right away is that 1.9's monthly budget report is
indeed sorting columns alphabetically rather than chronologically - not
very useful. I think a next priority is to merge
https://github.com/simonmichael/hledger/pull/739, fixing that; and
finish implementing sort options.
That pull request look really interesting and seems like it could open all
sorts of possibilities, like maybe comparing two budget reports against
each other (last year vs current year, or something similar).
Post by Simon Michael
And your empty -M and -Q budget reports are because of 1.9's
simple-minded selecting of only the monthly and quarterly periodic
transactions, which you have few of. (It looks like it should select the
"every Xth MON" rules, but isn't.)
I'd still like to know how 1.5 handles differing budget and report
interval. I commented out all but your first periodic txn, and looked at
the monthly income:work budget.
In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.
In a weekly report, it's zero in most weeks, and the full monthly amount
every so often. That's not bad, perhaps it would be more useful if it
smoothed it out across all weeks, but right now it does make sense when you
read it.
I would argue that "zero in most weeks and then full amount every so
often" matches actual behavior - after all, this is how salary will come
in, once per month with other weeks being "empty". If you smooth it out
allocating 1/4th every week then it will look like 3 weeks out of four do
not cosume budget amount and then suddlenly next one goes 200% over the
top, neither of which is true. Same logic could be applied to quarterly
transactions and monthly balance report and so on
Post by Simon Michael
So based on your actual experience, this to be working reasonably well
for you, and my concerns about the handling of different budget and report
intervals are unnecessary. It's looking increasingly like the right thing
to do is revert that part of my changes, and allow multi-interval budgets
again, in 1.9.1.
I for one would be super happy if this happens :)
Post by Simon Michael
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-23 21:41:21 UTC
Permalink
Thanks for the testing Dmitry. I have just pushed this and a few more commits to https://github.com/simonmichael/hledger/pull/739 <https://github.com/simonmichael/hledger/pull/739> , which I think begins to be mergeable now.

I had trouble making budgetRollup work right with the new BudgetReport implementation, not to mention understanding precisely what it does. I think I have got it doing just what it did in 1.5, except that it now looks for budget goals only within the report period, not over all time. Please let me know if I got this haddock right:

-- | Adjust a journal for budget reporting, hiding all or most unbudgeted subaccounts.
-- Specifically,
--
-- - account names with no budget goal are rewritten to their closest parent with a budget goal
-- (thereby hiding unbudgeted subaccounts of budgeted accounts, regardless of depth limit).
--
-- - accounts with no budgeted parent are rewritten to "<unbudgeted>:topaccountname"
-- (hiding subaccounts of unbudgeted accounts, regardless of depth limit),
-- unless --show-unbudgeted is provided.
--
-- This is slightly inconsistent/confusing but probably useful.

Re the "inconsistent/confusing" comment - I felt that way as both developer and user because of several small details about how it works. I guess I mean things like:

- unbudgeted pushes top-level accounts down a level, so that you have to add -1 if you want to a clean top-level report
- expanding the unbudgeted accounts to deeper levels requires --show-unbudgeted
- expanding budgeted accounts to deeper levels is not possible

At one point I disabled the feature and suddenly all the various bal --budget report modes (different depths, --flat, --tree) became much more intuitive to me, because it was just the standard balance report but with [budget goals] added to the accounts that have them. I figured you'd complain if I turned it off, because you wouldn't have built it without a need. Perhaps it shouldn't be on by default though ? Another idea might be to make it a query instead, eg to hide the unbudgeted accounts maybe something like not:budgetamt:0 could work.

Comments welcome.
Simon, I just built your "budget" branch with one-line change that could be seen in (https://github.com/simonmichael/hledger/compare/budget...adept:budget <https://github.com/simonmichael/hledger/compare/budget...adept:budget>) and I am happy camper again :) Display and formatting is better and cleaner, and all the numbers seem to line up.
This is very interesting, thanks for these details! I will study it.
One thing I can see right away is that 1.9's monthly budget report is indeed sorting columns alphabetically rather than chronologically - not very useful. I think a next priority is to merge https://github.com/simonmichael/hledger/pull/739 <https://github.com/simonmichael/hledger/pull/739>, fixing that; and finish implementing sort options.
That pull request look really interesting and seems like it could open all sorts of possibilities, like maybe comparing two budget reports against each other (last year vs current year, or something similar).
And your empty -M and -Q budget reports are because of 1.9's simple-minded selecting of only the monthly and quarterly periodic transactions, which you have few of. (It looks like it should select the "every Xth MON" rules, but isn't.)
I'd still like to know how 1.5 handles differing budget and report interval. I commented out all but your first periodic txn, and looked at the monthly income:work budget.
In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.
In a weekly report, it's zero in most weeks, and the full monthly amount every so often. That's not bad, perhaps it would be more useful if it smoothed it out across all weeks, but right now it does make sense when you read it.
I would argue that "zero in most weeks and then full amount every so often" matches actual behavior - after all, this is how salary will come in, once per month with other weeks being "empty". If you smooth it out allocating 1/4th every week then it will look like 3 weeks out of four do not cosume budget amount and then suddlenly next one goes 200% over the top, neither of which is true. Same logic could be applied to quarterly transactions and monthly balance report and so on
So based on your actual experience, this to be working reasonably well for you, and my concerns about the handling of different budget and report intervals are unnecessary. It's looking increasingly like the right thing to do is revert that part of my changes, and allow multi-interval budgets again, in 1.9.1.
I for one would be super happy if this happens :)
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
D. Astapov
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dmitry Astapov
2018-04-23 22:48:51 UTC
Permalink
Post by Simon Michael
Thanks for the testing Dmitry. I have just pushed this and a few more
commits to https://github.com/simonmichael/hledger/pull/739 , which I
think begins to be mergeable now.
I am reading them now, and I think that I've just marked everything as
reviewed, even though I am not yet done. I still have a bit more to read
Post by Simon Michael
I had trouble making budgetRollup work right with the new BudgetReport
implementation, not to mention understanding precisely what it does. I
think I have got it doing just what it did in 1.5, except that it now looks
for budget goals only within the report period, not over all time.
Yes, I agree, and IMO it made it better
Post by Simon Michael
-- | Adjust a journal for budget reporting, hiding all or most unbudgeted subaccounts.
-- Specifically,
--
-- - account names with no budget goal are rewritten to their closest
parent with a budget goal
-- (thereby hiding unbudgeted subaccounts of budgeted accounts,
regardless of depth limit).
--
-- - accounts with no budgeted parent are rewritten to
"<unbudgeted>:topaccountname"
-- (hiding subaccounts of unbudgeted accounts, regardless of depth limit),
-- unless --show-unbudgeted is provided.
--
-- This is slightly inconsistent/confusing but probably useful.
Yes, this sounds about right.
Re the "inconsistent/confusing" comment - I felt that way as both
developer and user because of several small details about how it works. I
- unbudgeted pushes top-level accounts down a level, so that you have to
add -1 if you want to a clean top-level report
- expanding the unbudgeted accounts to deeper levels requires
--show-unbudgeted
- expanding budgeted accounts to deeper levels is not possible
At one point I disabled the feature and suddenly all the various bal
--budget report modes (different depths, --flat, --tree) became much more
intuitive to me, because it was just the standard balance report but with
[budget goals] added to the accounts that have them. I figured you'd
complain if I turned it off, because you wouldn't have built it without a
need. Perhaps it shouldn't be on by default though ? Another idea might be
to make it a query instead, eg to hide the unbudgeted accounts maybe
something like not:budgetamt:0 could work.
This feature originates in hledger-budget that @ony wrote. It kinda grew
unto me later as well. Not sure what the original motiation is, but for me
it works as follows: lets say that I track groceries and cafes/restaurants
separately, but I have budget for "food" that is supposed to be spent on
sustenance of any kind. Then my budget transaction could be from "assets"
to "expenses:food", and real transactions from expenses:food:groceries and
expenses:food:cafes would "roll up" and be compared against budget for
expenses:food.

Or, alternatively, i can have budget for expenses:food:groceries and
another budget for expenses:food (which should capture everything else).
Then expenses:food:groceries would be compared to budget of
expenses:food:groceries, but expenses:food:cafes, expenses:food:lunch at
work, expenses:food:coffe etc wold all "roll up" into expenses:food and be
compared to budget of expenses:food. Or, in other words: "do i have a
budget for this account? if not, lets push thint's balance to its parent --
maybe there is a budget there. Rinse and repeat, in bottom-up traversal"

As you can see from the second example, "roll-up" is not equivalent to
"--depth N". Rather, it is as if for each account you have its own "depth"
setting, but instead of setting it directly you are saying "let it be the
depth of the nearest account with some budget on the way to root"

I am basically indifferent wither it is on by default or off, but i would
be sad to see it go - it is yet another tool that allows you to live with
coarse(r) budgets. Time-wise you can make your budget coarser by writing
down monthy numbers instead of weekly/daily etc. Account-wise, you could
specify coarse budget for expenses:foo instead of coming up with several
budgets for expenses:foo:{bar,baz,quux,...}

Same for income, of course: if you track various sources of income, your
budget could say "i expect to earn 1.000.000 in 'income'", which would be
compared to rolled-up aggregate of income:source1, income:source2, ...




Comments welcome.
Post by Simon Michael
Simon, I just built your "budget" branch with one-line change that could
be seen in (https://github.com/simonmichael/hledger/compare/
budget...adept:budget) and I am happy camper again :) Display and
formatting is better and cleaner, and all the numbers seem to line up.
Post by Dmitry Astapov
Post by Simon Michael
This is very interesting, thanks for these details! I will study it.
One thing I can see right away is that 1.9's monthly budget report is
indeed sorting columns alphabetically rather than chronologically - not
very useful. I think a next priority is to merge https://github.com/
simonmichael/hledger/pull/739, fixing that; and finish implementing
sort options.
That pull request look really interesting and seems like it could open
all sorts of possibilities, like maybe comparing two budget reports against
each other (last year vs current year, or something similar).
Post by Simon Michael
And your empty -M and -Q budget reports are because of 1.9's
simple-minded selecting of only the monthly and quarterly periodic
transactions, which you have few of. (It looks like it should select the
"every Xth MON" rules, but isn't.)
I'd still like to know how 1.5 handles differing budget and report
interval. I commented out all but your first periodic txn, and looked at
the monthly income:work budget.
In a quarterly report, I can see it's multiplied by 3. So that seems to work fine.
In a weekly report, it's zero in most weeks, and the full monthly amount
every so often. That's not bad, perhaps it would be more useful if it
smoothed it out across all weeks, but right now it does make sense when you
read it.
I would argue that "zero in most weeks and then full amount every so
often" matches actual behavior - after all, this is how salary will come
in, once per month with other weeks being "empty". If you smooth it out
allocating 1/4th every week then it will look like 3 weeks out of four do
not cosume budget amount and then suddlenly next one goes 200% over the
top, neither of which is true. Same logic could be applied to quarterly
transactions and monthly balance report and so on
Post by Simon Michael
So based on your actual experience, this to be working reasonably well
for you, and my concerns about the handling of different budget and report
intervals are unnecessary. It's looking increasingly like the right thing
to do is revert that part of my changes, and allow multi-interval budgets
again, in 1.9.1.
I for one would be super happy if this happens :)
Post by Simon Michael
--
You received this message because you are subscribed to the Google
Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-04-24 01:52:13 UTC
Permalink
Post by Simon Michael
- unbudgeted pushes top-level accounts down a level, so that you have to add -1 if you want to a clean top-level report
- expanding the unbudgeted accounts to deeper levels requires --show-unbudgeted
- expanding budgeted accounts to deeper levels is not possible
At one point I disabled the feature and suddenly all the various bal --budget report modes (different depths, --flat, --tree) became much more intuitive to me, because it was just the standard balance report but with [budget goals] added to the accounts that have them. I figured you'd complain if I turned it off, because you wouldn't have built it without a need. Perhaps it shouldn't be on by default though ? Another idea might be to make it a query instead, eg to hide the unbudgeted accounts maybe something like not:budgetamt:0 could work.
Or, alternatively, i can have budget for expenses:food:groceries and another budget for expenses:food (which should capture everything else). Then expenses:food:groceries would be compared to budget of expenses:food:groceries, but expenses:food:cafes, expenses:food:lunch at work, expenses:food:coffe etc wold all "roll up" into expenses:food and be compared to budget of expenses:food. Or, in other words: "do i have a budget for this account? if not, lets push thint's balance to its parent -- maybe there is a budget there. Rinse and repeat, in bottom-up traversal"
As you can see from the second example, "roll-up" is not equivalent to "--depth N". Rather, it is as if for each account you have its own "depth" setting, but instead of setting it directly you are saying "let it be the depth of the nearest account with some budget on the way to root"
I am basically indifferent wither it is on by default or off, but i would be sad to see it go - it is yet another tool that allows you to live with coarse(r) budgets. Time-wise you can make your budget coarser by writing down monthy numbers instead of weekly/daily etc. Account-wise, you could specify coarse budget for expenses:foo instead of coming up with several budgets for expenses:foo:{bar,baz,quux,...}
Same for income, of course: if you track various sources of income, your budget could say "i expect to earn 1.000.000 in 'income'", which would be compared to rolled-up aggregate of income:source1, income:source2, ...
I'm a big fan of rolling up (or depth limiting/depth clipping as I call it) to see a bigger picture. The way this feature works right now, the rules are a bit more complex and I found a bit hard to learn. But I am talking from very limited real world experience with it, compared to you and (I assume) ony. Time to use it some more, and maybe tweak some docs. Thanks for the comments and code review, I will go ahead and merge.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joel Buckley
2018-04-21 00:41:16 UTC
Permalink
A good point. As you say, this hinges upon the clunkiness of defining
multiple daily transactions using a different basis.

A lot of the problems of pro-rating here are also problems that will arise
silently in the budget otherwise: for a budget that spans more than one
moth, there will be inaccuracies in the assumed number of weekdays for each
month.

Can you think of an example with a sufficiently articulate budget
definition?
Post by Dmitry Astapov
The problem with dividing is that it might not reflect the actual usage
pattern. For example: lets say I have a cup of coffee at work (usually) and
have a monthly budget for that. If generating daily report will divide
monthly budget by 30/31 days, this would be wrong, as I only drink coffee
on weekdays, but hledger will have no way to know that.
One, of course, can argue that in this case much better solution overall
will be to have daily budget for coffee for Mon-Fri, but it would be
cumbersome to define (you will need 5 separate budgets - one for Mon, Tue,
... each).
But I think this illustrates potential issues with dividing budgets.
Post by Joel Buckley
So from reading the other thread yesterday (happy to carry on there if
you'd prefer), and wondering if I was using an incorrect paradigm in trying
to do budgeting today, I pondered something similar. Perhaps coming from a
place of naïvety given my relatively new familiarity with plain text
- A budget on a macro time-scale can 'bundle up' all of the budgets
on a smaller or the same time-scales. So, if you're budgeting on a
'monthly' time-scale ('monthly' meaning only that the unit of time is
incremented by one month — perhaps 3, 4 or 5 months are being inspected at
any one time), then you want to see an accounting for every periodic
transaction that will have been matched between the start and the end of
the budget window (say 2018/02/01 – 2018/07/01). This could include events
with regularity such as daily, every third Tuesday, and every second month.
- Otherwise, in similar sorts of scenarios elsewhere, it's not
unreasonable to apportion figures in proportion to their degree. That is,
if I have a straightforward budget consisting only of monthly expenses, and
I choose to look at 3 days for a budget query, I simply divide those
budgeted monthly figures by the number of days in the month, and multiply
by 3 (the number of days I am examining). Perhaps from my inexperience, I
can't envisage a general use-case that isn't a user who has a normal array
of scheduled budgeting information (some monthly, some more esoteric), and
wants to look more granularly at his/her information, to the exclusion of
the broader picture.
*Weekly report with a monthly budget:* divide budget items up by pro-rating
*Monthly report with a weekly budget:* add it up, simply as a
longer-term view of the weekly budget
How does that gel with your thoughts along these lines?
Post by Simon Michael
You can! But we'd prefer not to add a switch if possible. And before it
could happen, multi-interval budgets need more thought and coding work.
We need to specify, in detail, how reporting should work when budget and
- you run a weekly report with a monthly budget
- you run a monthly report with a weekly budget
Ah, thanks for the link.
As I assume you're the one who actioned this change — could I request a
command line switch, so that both our approaches are possible?
Post by Simon Michael
Hi Joel, welcome.
https://groups.google.com/d/msg/hledger/0JL2ZHVxm_c/p59ASChOCAAJ
Hi,
I'm relatively new to hledger and plain text accounting, but so far I'm
enjoying it very much.
Today I looked into budgeting using hledger, and I am having some
difficulty. I would like to use *multiple periodic transactions* of a*
differing basis* (e.g. monthly, every third Tuesday, daily), and have
this show up in the nice summary table that can be constructed, with a %
'completion' figure.
;; Budget
~ monthly
income $2000
expenses:food $400
expenses:bus $50
assets:bank:checking
~ every 3rd tue from 2018/04/07
expenses:movies $30
;; Two months worth of expenses
2017-11-01
income $1950
expenses:food $396
expenses:bus $49
expenses:movies $30
expenses:supplies $20
assets:bank:checking
2017-12-01
income $2100
expenses:food $412
expenses:bus $53
expenses:gifts $100
assets:bank:checking
When I run $ hledger balance -M --budget -f ~/test.journal
|| 2017/11/30
2017/12/31
======================++====================================================
assets:bank:checking || $-2445 [ 100% of $-2450] $-5110 [ 104% of $-4900]
expenses:bus || $49 [ 98% of $50] $102 [ 102% of
$100]
expenses:food || $396 [ 99% of $400] $808 [ 101% of
$800]
expenses:gifts || 0 $100
expenses:movies || $30 $30
expenses:supplies || $20 $20
income || $1950 [ 98% of $2000] $4050 [ 101% of $4000]
----------------------++----------------------------------------------------
|| 0 [ 0% of 0] 0 [ 0% of
0]
But even though an expense:movies budget is specified in the file, it
doesn't get shown here like [ 101% of $800]is. I discovered that the
-M flag only looks at ~ monthly items, but I can't discover an
invocation that will show *all* of the budgets over my desired
timeframe.
Thanks for any light that can be shed here,
Joel
--
You received this message because you are subscribed to the Google
Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
D. Astapov
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...