You can use the limit command to include onle transactions that match the given condition.
ledger reg Account --limit "amount>0" On Tue, Jun 26, 2012 at 3:45 PM, Christopher Allan Webber < [email protected]> wrote: > Hi all, > > I have a puzzling question for you. > > Say I have an account that has a bunch of money going in, and a bunch of > money going out. I just want to find out how much money went *into* an > account over a period of time. > > I'd like something along the lines of `ledger reg` output, except where > the running balance on the right is something like: > > Say I have something like this: > > #+begin_src ledger > 2012/05/01 Money goes in > Assets:Something unrelated $9000.00 > Income:Herp derp > > 2012/05/02 Money goes in > Assets:FOO pool $1025.6 > Income:Herp derp > > 2012/05/12 Money comes out > Expenses:Costs $600.00 > Assets:FOO pool > > 2012/06/11 Mo money mo problems > Assets:FOO pool $2000.00 > Income:Herp derp > > 2012/06/11 Mo money comes out > Expenses:Costs $1500.00 > Assets:FOO pool > > 2012/06/21 Paid again > Assets:FOO pool $300.00 > Income:Herp derp > #+end_src ledger > > If I run this command: > > $ ledger -f herpderp.ldgr reg "foo pool" > 12-May-02 Money goes in Assets:FOO pool $1025.60 > $1025.60 > 12-May-12 Money comes out Assets:FOO pool $-600.00 > $425.60 > 12-Jun-11 Mo money mo problems Assets:FOO pool $2000.00 > $2425.60 > 12-Jun-11 Mo money comes out Assets:FOO pool $-1500.00 > $925.60 > 12-Jun-21 Paid again Assets:FOO pool $300.00 > $1225.60 > > Of course, I get the transaction of things. But I want to see *just* > the income. So I can do this: > > $ ledger -f herpderp.ldgr -d "b>0" reg "foo pool" > 12-May-02 Money goes in Assets:FOO pool $1025.60 > $1025.60 > 12-Jun-11 Mo money mo problems Assets:FOO pool $2000.00 > $2425.60 > 12-Jun-21 Paid again Assets:FOO pool $300.00 > $1225.60 > > But what I really want is to have the right hand column not say the > state of the account in reality, but the state of the account from > within these transactions listed. So what I'd like to see is: > > $ ledger -f herpderp.ldgr -d "b>0" reg "foo pool" --sumthing > 12-May-02 Money goes in Assets:FOO pool $1025.60 > $1025.60 > 12-Jun-11 Mo money mo problems Assets:FOO pool $2000.00 > $2025.00 > 12-Jun-21 Paid again Assets:FOO pool $300.00 > $2325.60 > > I'm not sure what something would be --sumthing, but it would be good to > have it. :) > > Is there an existing trick to pull this off? > > - Chris > -- Craig, Corona De Tucson, AZ enderw88.wordpress.com
