@c  -r, --related          calculate report using related postings

Normally, a register report includes only the postings that match
the regular expressions specified after the command word.  For
example, to report all expenses:

@example
ledger reg ^expenses
@end example

This reports:

@smallexample
2004/05/29 Book Store           Expenses:Books               $20.00       $20.00
@end smallexample

Using @option{--related} (@option{-r}) reports the postings that
did not match your query, but only in transactions that otherwise would
have matched.  This has the effect of indicating where money came
from, or when to:

@example
ledger -r reg ^expenses
@end example

Reports:

@smallexample
2004/05/29 Book Store           Liabilities:MasterCard       $20.00       $20.00
@end smallexample