Filter transactions based on other accounts involved

389 views
Skip to first unread message

Kumar Appaiah

unread,
Nov 4, 2016, 12:45:10 AM11/4/16
to Ledger
Dear Ledger users,

I couldn't figure this out from the documentation and prior posts, so maybe I am missing something, more likely due to my misunderstanding of accounting concepts. Here are my queries.

1. Suppose that I have several transactions going into an account from different sources. For example:

* 2010/01/01 * T1
    Accounts:Hub    30.00 USD
    Accounts:A1

* 2010/01/01 * T2
    Accounts:Hub    40.00 USD
    Accounts:A2

* 2010/01/01 * T3
    Accounts:Hub    10.00 USD
    Accounts:A1

Now, I wish to list all transactions that pay into Accounts:Hub ONLY from Accounts:A1. How can I write a query like that? My cursory filtering attempts didn't work.

2. The register displays all transactions that put a commodity into or take a commodity out of an account. Can I display where the money comes from/goes to as well? In other words, can I get the complete transaction detail in the register?

Thanks.

Kumar

Martin Michlmayr

unread,
Nov 4, 2016, 2:58:21 AM11/4/16
to ledge...@googlegroups.com
* Kumar Appaiah <a.k...@alumni.iitm.ac.in> [2016-11-03 21:22]:
> Now, I wish to list all transactions that pay into Accounts:Hub ONLY
> from Accounts:A1. How can I write a query like that? My cursory
> filtering attempts didn't work.

reg Accounts:Hub -l 'any(account =~ /Accounts:A1/)'

> 2. The register displays all transactions that put a commodity into
> or take a commodity out of an account. Can I display where the money
> comes from/goes to as well? In other words, can I get the complete
> transaction detail in the register?

--related

--
Martin Michlmayr
http://www.cyrius.com/

Kumar Appaiah

unread,
Nov 4, 2016, 5:40:57 AM11/4/16
to Ledger

Thanks for both. I'll reread the documentation as well.

Kumar

Kumar Appaiah

unread,
Nov 4, 2016, 7:13:11 AM11/4/16
to Ledger

On Friday, November 4, 2016 at 3:10:57 PM UTC+5:30, Kumar Appaiah wrote:

On Friday, November 4, 2016 at 12:28:21 PM UTC+5:30, Martin Michlmayr wrote:
* Kumar Appaiah <a.k...@alumni.iitm.ac.in> [2016-11-03 21:22]:
> Now, I wish to list all transactions that pay into Accounts:Hub ONLY
> from Accounts:A1. How can I write a query like that? My cursory
> filtering attempts didn't work.

reg Accounts:Hub -l 'any(account =~ /Accounts:A1/)'


Actually, I checked the ledger3.html file, and I don't see a reference to "any" anywhere. Is it missing or am I unable to spot it correctly?

Thanks.

Kumar

Manuel Amador (Rudd-O)

unread,
Nov 6, 2016, 7:08:26 PM11/6/16
to ledge...@googlegroups.com
On 11/04/2016 06:58 AM, Martin Michlmayr wrote:
>
>> 2. The register displays all transactions that put a commodity into
>> or take a commodity out of an account. Can I display where the money
>> comes from/goes to as well? In other words, can I get the complete
>> transaction detail in the register?
> --related

How do you see both incoming and outgoing accounts?


--
Rudd-O
http://rudd-o.com/

Simon Michael

unread,
Nov 6, 2016, 11:22:46 PM11/6/16
to ledge...@googlegroups.com
ledger -f t.ledger print Accounts:Hub | ledger -f - print A1 ?


Manuel Amador (Rudd-O)

unread,
Nov 7, 2016, 6:17:43 PM11/7/16
to ledge...@googlegroups.com
Huh?

--
Rudd-O
http://rudd-o.com/

Manuel Amador (Rudd-O)

unread,
Nov 13, 2016, 2:46:37 PM11/13/16
to ledge...@googlegroups.com
On 11/07/2016 04:22 AM, Simon Michael wrote:
For the record, the answer was --related-all .

--
Rudd-O
http://rudd-o.com/

Reply all
Reply to author
Forward
0 new messages