hledger Verified current stable Not installed? Data Processing

Hledger / Show Monthly Revenues Expenses

Show Monthly Revenues Expenses

Provide a summary of monthly revenues and expenses with hledger.

$
Terminal
hledger is -M

When To Use

During budget forecasting or financial performance evaluations to analyze monthly fluctuations.

Pro Tip

Use aggregation flags for refined summaries; performance may degrade with large datasets without optimizations.

Anatomy of Output

Understanding the result

January 2023: Total Income $15,000.00 January Income

Total income calculated for January.

February 2023: Total Income $18,000.00 February Income

Total income calculated for February.

January 2023: Total Expenses $5,000.00 January Expenses

Total expenses calculated for January.

February 2023: Total Expenses $7,000.00 February Expenses

Total expenses calculated for February.

Power User Variants

Optimized versions

hledger incomestatement -M --period this_year

Monthly income for the current year.

hledger incomestatement -M --period last_year

Monthly income for the previous year.

Troubleshooting

Common pitfalls

Error: no data found for the specified month

Solution: Verify the ledger entries are correct for the month.

Error: unsupported period format

Solution: Use recognized formats such as YYYY-MM.

Error: cannot parse ledger file

Solution: Ensure the ledger file is correctly formatted.

Command Breakdown

What each part is doing

hledger
Base Command
The executable that performs this operation. Here it runs Hledger before the shell applies any redirect operators.
is
is|incomestatement
The value supplied for is|incomestatement.
-M
M| monthly
The value supplied for M| monthly.
-M
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.