LinuxCommandLibrary

hledger-incomestatement

Generate an income statement from hledger data

TLDR

Show revenues and expenses (changes in Revenue and Expense accounts)

$ hledger [[is|incomestatement]]
copy

Show revenues and expenses each month
$ hledger [[is|incomestatement]] [[-M|--monthly]]
copy

Show monthly revenues/expenses/totals, largest first, summarised to 2 levels
$ hledger [[is|incomestatement]] [[-MTAS|--monthly --row-total --average --sort-amount]] [[-2|--depth 2]]
copy

Same as above, and generate HTML output in is.html
$ hledger [[is|incomestatement]] [[-MTAS|--monthly --row-total --average --sort-amount]] [[-2|--depth 2]] [[-o|--output-file]] is.html
copy

SYNOPSIS

hledger incomestatement [OPTION...] [PATTERN...]

PARAMETERS

-f --file FILE
    Read FILE(s) instead of $LEDGER_FILE

--add-amount
    Show both amount and total amount columns

--account PATTERNS
    This option affects reports

--average[=PERIOD]
    Show average over the period

--change
    Show period-to-period change

--cumulative
    Show cumulative totals within periods

--historical | -H
    Include historical ending balances

--invert
    Reverse sign of values

--no-total | -n
    Omit summary totals

--only
    Show only matches, no parents

--period PERIOD | -p PERIOD
    Report period

--real
    Show only commodity currencies

--row-depth=N
    Show accounts at least N levels deep

--today | --today-end
    Limit to today or end of today

-o --output FILE
    Write output to FILE

-O --outformat FMT
    Output format: txt, csv, html, json

DESCRIPTION

The hledger incomestatement command produces an income statement (profit & loss report) from plain text accounting journals managed by hledger. It displays revenue and expense accounts hierarchically, with subtotals for classes like Income, Expenses, and a net Profit/Loss total. Transactions are aggregated over specified date ranges, supporting multi-currency and multi-period analysis.

hledger uses double-entry bookkeeping in simple text files. Users post debits/credits to revenue (Income:) and expense (Expenses:) accounts. The report filters by account patterns, computes period totals, changes, averages, or cumulatives, and handles historical balances for closed accounts.

Output is an ASCII table by default, customizable to CSV, HTML, or JSON. Common uses include tracking business profitability, personal budgeting, or project finances. Integrates with hledger's ecosystem for balance sheets, cashflow, and registers. Requires accounts prefixed with Income: or Expenses: for proper classification; otherwise, falls back to balance report behavior.

Ideal for terminal-based accounting without databases, emphasizing reproducibility via git-tracked journals.

CAVEATS

Assumes Income:/Expenses: account prefixes for classification; without them, behaves like hledger balance. Multi-commodity reports may need --real. No built-in charts; use external tools.

EXAMPLE USAGE

hledger incomestatement -p '2023'
Shows yearly income statement.

hledger incomestatement --change Income: --period 'monthly 2023'
Monthly revenue changes.

ACCOUNT SETUP

Declare accounts like:
account Income:Salary
account Expenses:Groceries
Post transactions: 2023/1/1 Salary $5000

HISTORY

Developed by Simon Michael as part of hledger (fork of ledger/hdl), started 2007. Incomestatement command added in hledger 0.24 (2014), enhanced with multiperiod, averages, and HTML output in later versions (1.0+). Actively maintained, version 1.33 as of 2024.

SEE ALSO

hledger(1), hledger-balance(1), hledger-balancesheet(1), hledger-cashflow(1), ledger(1)

Copied to clipboard