>>>>> Martin Michlmayr <t...@cyrius.com
> You want to --group-by the Assets: account to find on which broker account
> you received dividends, e.g.:
> bal Income:Dividends --group-by get_account("^Assets:Broker")
I'm not sure this means what you expect it to mean...
--group-by EXPR evaluates EXPR *for every entry in the report* and then groups
the results by the strings yielded from that evaluation.
What you seem to want is this:
1. for an entry that matches account X
2. filter the *other* posts in that transaction by those matching account Y
3. use the (assumed single) account name resulting from this for grouping
This can't be done with Ledger's command-line option, although it would be
possible as a Python script.