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 [OPTIONS] [ACCOUNT_QUERY...]

PARAMETERS

-f FILE, --file=FILE
    Specifies the path to the hledger journal file to use.

-b DATE, --begin=DATE
    Sets the start date for the report period (e.g., '2023-01-01').

-e DATE, --end=DATE
    Sets the end date for the report period (e.g., '2023-12-31').

-p PERIOD, --period=PERIOD
    Defines a common period for the report (e.g., 'last month', 'this year'). Overrides -b and -e.

-D, --daily
    Segments the report by daily intervals.

-W, --weekly
    Segments the report by weekly intervals.

-M, --monthly
    Segments the report by monthly intervals.

-Q, --quarterly
    Segments the report by quarterly intervals.

-Y, --yearly
    Segments the report by yearly intervals.

-s, --subaccounts
    Displays individual subaccounts rather than consolidating them into their parent accounts.

-T, --tree
    Presents accounts in a hierarchical tree structure, reflecting their parent-child relationships.

--depth=N
    Limits the displayed depth of the account tree when used with --tree.

-t, --add-total
    Adds a final total line, typically showing the net profit/loss for the period.

--layout=LAYOUT
    Specifies the output layout. Common values include 'wide', 'narrow', or 'compact'.

--net-profit-only
    Displays only the final net profit/loss total, suppressing detailed income and expense lines.

--income-first
    Orders the report to display income accounts before expense accounts (this is the default behavior).

--expenses-first
    Orders the report to display expense accounts before income accounts.

ACCOUNT_QUERY...
    One or more regular expressions to filter which accounts are included in the report. For example, ^income to show only income accounts, or Travel to show only travel-related expenses.

DESCRIPTION

The hledger-incomestatement command, typically an alias for hledger income, produces a financial report that summarizes an entity's revenues, expenses, and net profit or loss over a specific period. It is a crucial tool for understanding financial performance by showing how much money was earned and spent during a reporting interval.

This command works by aggregating all transactions posted to accounts designated as 'Income' and 'Expenses' within your hledger plain-text journal file. Users can specify various parameters such as date ranges, reporting periodicity (daily, monthly, yearly), and account filtering to tailor the report. The output typically displays a hierarchical breakdown of income sources and expense categories, culminating in a calculation of the net profit or loss.

It's an essential report for budgeting, financial analysis, and decision-making, allowing users to quickly assess profitability and identify areas of spending or income trends within their financial records managed by hledger.

CAVEATS

The command hledger-incomestatement is primarily a shell alias or wrapper script for the core hledger income command. Its functionality is identical to hledger income. For accurate reporting, it relies on a well-structured hledger journal where income and expense accounts are clearly defined (typically as top-level 'Income' and 'Expenses' accounts). This report provides a cash-basis view unless specific accrual entries are manually recorded. Accuracy is entirely dependent on the correctness and completeness of your journal entries.

Keep in mind that hledger's income statement focuses purely on income and expense accounts, not assets, liabilities, or equity, which are covered by other reports like the balance sheet.

TYPICAL ACCOUNT STRUCTURE

For hledger to correctly generate an income statement, your journal accounts should follow a hierarchical structure. Typically, accounts relevant to the income statement begin with 'Income' or 'Expenses'. For example:

Income:Salary
Income:Investments
Expenses:Rent
Expenses:Groceries
Expenses:Utilities:Electricity

The command automatically identifies these top-level accounts and aggregates their subaccounts accordingly.

EXAMPLE USAGE

To view your income statement for the current year, broken down monthly, with a total line and subaccounts:

hledger-incomestatement --monthly --add-total --subaccounts -p 'this year'

To see only the net profit for the last fiscal quarter:

hledger-incomestatement --net-profit-only -p 'last quarter'

To view expenses only for a specific account, like 'Travel', for all time:

hledger-incomestatement ^Expenses:Travel

HISTORY

hledger is a modern, free software project implemented in Haskell, inspired by the venerable ledger command-line accounting system. Developed with a focus on plain-text accounting principles, hledger aims to provide a robust, flexible, and user-friendly tool for personal and small business finance.

The income statement report, being a fundamental financial statement, was a core feature integrated into hledger from its early development. Its continuous refinement mirrors hledger's ongoing improvements in parsing, reporting, and user experience, ensuring it remains an accurate and powerful tool for financial performance analysis.

SEE ALSO

hledger(1), hledger-balance(1), hledger-register(1), hledger-print(1), hledger-chart(1), ledger(1)

Copied to clipboard