Hi guys,

I'm a little confused about forecasting and budgeting. I'd like to blame
the manual. The first example in the section about budgeting says to use
arguments like -p and -MAs, none of which helped me get what I wanted -- a
cumulative budget showing how much I'd overspent/underspent what I expected
since its beginning. I think I've got a better understanding now, but it's
still incomplete.

Here's a simple ledger where I budget for large purchases. I set aside $1
each month towards big purchases, which I'll make every few months.

~ monthly from 2013/1/1
    Assets         $-1
    Expenses:Furniture    $1

2013/1/1 Salary
  Assets:Checking   $20
  Income:Salary

2013/1/1 Chair
  Assets:Checking  $-5
  Expenses:Furniture

It seems to make sense, because I can use the "budget" command to show how
far under/over I am.

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
budget
         $15          $-1          $16 -1500%  Assets
          $5           $1           $4  500%  Expenses:Furniture
------------ ------------ ------------ -----
         $20            0          $20     0

Meaning, "today I've overspent by $4".

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
budget --now=2013/06/1
         $15          $-6          $21 -250%  Assets
          $5           $6          $-1   83%  Expenses:Furniture
------------ ------------ ------------ -----
         $20            0          $20     0

But, if I don't buy anything else until June, I will have underspent by $1.

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
--budget reg --now=2013/06/01 Expe
13-Jan-01 Budget transaction    Expenses:Furniture
$-1          $-1
13-Jan-01 Chair                 Expenses:Furniture
$5           $4
13-Feb-01 Budget transaction    Expenses:Furniture
$-1           $3
13-Mar-01 Budget transaction    Expenses:Furniture
$-1           $2
13-Apr-01 Budget transaction    Expenses:Furniture
$-1           $1
13-May-01 Budget transaction    Expenses:Furniture
$-1            0
13-Jun-01 Budget transaction    Expenses:Furniture
$-1          $-1

This shows how over/under budget I am. At first I am slightly under budget,
because the transaction to allocate the money happened before the actual
purchase. Then I am over budget for a few months while I "pay it off".

I'd like to use the --forecast option here to show me when I am next "under
budget". In a perfect world I'd write a query like "forecast until the
running total is less than 0 and the date is in the future". Here are
queries I've tried in the meantime.

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
--budget reg --forecast "T<{\$0}" Expe
13-Jan-01 Budget transaction    Expenses:Furniture
$-1          $-1

OK, the manual says that --forecast will produce transactions "until the
condition is true". The very first transaction makes this true, so it makes
sense that it would just print the first one and stop. So let's try
changing the condition to something that will definitely happen in the
future:

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
--budget reg --forecast "T={\$0}" Expe

No output??

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat
--budget reg --forecast "T<{\$-1}" Expe

No output??

Maybe this is a problem with using both --forecast and the --budget option.
WIthout --budget, I get:

$ ./build/ledger/opt/ledger -f ~/Documents/finances/ledger/forecast.dat reg
--forecast "T>{\$-1}" Expe
13-Jan-01 Chair                 Expenses:Furniture
$5           $5
13-Feb-01 Forecast transaction  Expenses:Furniture
$1           $6
13-Mar-01 Forecast transaction  Expenses:Furniture
$1           $7
13-Apr-01 Forecast transaction  Expenses:Furniture
$1           $8
13-May-01 Forecast transaction  Expenses:Furniture
$1           $9
13-Jun-01 Forecast transaction  Expenses:Furniture
$1          $10

I get the feeling that I'm doing something wrong here. --budget creates
transactions that are the opposite of the periodic transactions. --forecast
creates transactions that exactly match the periodic transactions.

Any advice appreciated..

Ethan

Reply via email to