2024-05-28 18:17:26 -10:00
|
|
|
# hledger balance
|
|
|
|
|
|
|
|
> A flexible, general purpose "summing" report that shows accounts with some kind of numeric data.
|
|
|
|
> This can be balance changes per period, end balances, budget performance, unrealised capital gains, etc.
|
|
|
|
> More information: <https://hledger.org/hledger.html#balance>.
|
|
|
|
|
|
|
|
- Show the balance change in all accounts from all postings over all time:
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`hledger {{[bal|balance]}}`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
|
|
|
- Show the balance change in accounts named `*expenses*`, as a tree, summarising the top two levels only:
|
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
`hledger {{[bal|balance]}} {{expenses}} {{[-t|--tree]}} {{[-2|--depth 2]}}`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
|
|
|
- Show expenses each month, and their totals and averages, sorted by total; and their monthly budget goals:
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`hledger {{[bal|balance]}} {{expenses}} {{[-M|--monthly]}} {{[-T|--row-total]}} {{[-A|--average]}} {{[-S|--sort-amount]}} --budget`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
- Similar to the above, matching accounts by `Expense` type, as a two level tree without squashing boring accounts:
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
`hledger {{[bal|balance]}} type:{{X}} {{[-MTAS|--monthly --row-total --average --sort-amount]}} --budget {{[-t|--tree]}} {{[-2|--depth 2]}} --no-elide`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
|
|
|
- Show end balances (including from postings before the start date), quarterly in 2024, in accounts named `*assets*` or `*liabilities*`:
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`hledger {{[bal|balance]}} {{[-H|--historical]}} {{[-p|--period]}} '{{quarterly in 2024}}' {{assets}} {{liabilities}}`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
- Similar to the above, also show zero balances, sort by total and summarise to three levels:
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
`hledger {{[bal|balance]}} {{[-HQ|--historical --quarterly]}} date:{{2024}} type:{{AL}} {{[-ES|--empty --sort-amount]}} {{[-3|--depth 3]}}`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
- Show investment assets' market [V]alue in base currency at the end of each quarter:
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
`hledger {{[bal|balance]}} {{[-HVQ|--historical --market --quarterly]}} {{assets:investments}}`
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2024-05-29 22:41:08 -10:00
|
|
|
- Show unrealised capital gains/losses from market price changes in each quarter, for non-cryptocurrency investment assets:
|
2024-05-28 18:17:26 -10:00
|
|
|
|
2025-05-04 10:20:26 +03:00
|
|
|
`hledger {{[bal|balance]}} --gain {{[-Q|--quarterly]}} {{assets:investments}} not:{{cryptocurrency}}`
|