Discussion:
Min/Max values
Jungle Boogie
2018-08-22 05:03:39 UTC
Permalink
Hi All,

I record fuel transactions as a commodity:

2018/08/21 * Arco
Expenses:Auto:2018:Fuel:Maceo 75 gallons @ $3.019
Assets:Cash:Wallet -$226.42

Say I do this for an entire year, but the fuel prices change from
transaction-to-transaction. At the end of the year, I'd like to know the
min and max values of these transactions.

Is there a fancy regex that would generate this kind of report, either price per
gallon or after it's converted with -B?

Also, what about listing reguar expense transactions with a range?
Show all Grocery transactions from this year which are over $100

Thanks,
j.b.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-08-22 12:09:15 UTC
Permalink
Post by Jungle Boogie
Hi All,
2018/08/21 * Arco
Assets:Cash:Wallet -$226.42
Say I do this for an entire year, but the fuel prices change from
transaction-to-transaction. At the end of the year, I'd like to know the
min and max values of these transactions.
Is there a fancy regex that would generate this kind of report, either price per
gallon or after it's converted with -B?
The prices command can help, eg:

2018/07/01 * Arco
Expenses:Auto:2018:Fuel:Maceo 75 gallons @ $3.019
Assets:Cash:Wallet -$226.42

2018/08/01 * Arco
Expenses:Auto:2018:Fuel:Maceo 70 gallons @ $4
Assets:Cash:Wallet

2018/09/01 * Arco
Expenses:Auto:2018:Fuel:Maceo 80 gallons @ $3
Assets:Cash:Wallet

$ hledger prices --costs | sort -k4
P 2018-09-01 gallons $3
P 2018-07-01 gallons $3.019
P 2018-08-01 gallons $4
Post by Jungle Boogie
, what about listing reguar expense transactions with a range?
Show all Grocery transactions from this year which are over $100
amt: matches amounts, eg:

$ hledger reg fuel amt:'>70'
2018/07/01 Arco ..:Maceo 75 gallons 75 gallons
2018/09/01 Arco ..:Maceo 80 gallons 155 gallons

To match on the dollar amount there, you'd need two steps, since amt: doesn't see -B (should it ? PR welcome):

$ hledger print -B | hledger -f- reg fuel amt:'>230' amt:'<260'
2018/09/01 Arco ..u:20:Fu:Maceo $240.00 $240.00
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...