Convert a YNAB (You Need a Budget) export to a Ledger journal.
First, make sure your budget settings in YNAB match these options, so that the exported CSV will be in the expected format. Open YNAB, click the top left corner, and choose "Budget Settings":
- Make sure the setting Number Format is set to "123.45" or similar (the decimal point should be
.
, not,
). - Make sure the date format is set to the American format "mm/dd/yyyy", for example, "12/30/2015".
Now, export your data from YNAB:
- Go to My Budget -> Export budget data
- Download and unzip the archive
Next, run ynab_to_ledger.rb
to convert the export to a Ledger file:
ruby ynab_to_ledger.rb My\ Budget\ as\ of\ 2016-10-02\ 1007\ PM\ -\ Register.csv
This will write out a ynab_ledger.dat
journal.
Now that you've got a Ledger journal, you can use the Ledger command line to run reports. For example:
View a monthly register:
ledger register -f ynab_ledger.dat --monthly
You can filter the register down to just the category you care about:
ledger register -f ynab_ledger.dat --monthly Dining Out
And you can even see a running average of the amount:
ledger register -f ynab_ledger.dat --monthly --average Dining Out
Balances for a single month summed by category:
ledger balance -f ynab_ledger.dat --begin 2016-09-01 --end 2016-10-01 --depth 1
You can see more reports at http://ledger-cli.org/3.0/doc/ledger3.html#Building-Reports
hledger (a port of Ledger) provides some reporting that Ledger does not. For example, you can view a monthly register rolled up by category:
hledger register -f ynab_ledger.dat --monthly --depth 1
Multicolumn balance report by month with averaging:
hledger balance -f ynab_ledger.dat --average --monthly --begin 2017-01-01 --end 2017-12-31