* John Lee <[email protected]> [2018-12-09 15:34]:
> I have a ledger with investments like this:
>
> 2018-12-09 * Investment
> Assets:Investments:Funds 1 GOOG @ $1000
> Assets:Investments:Funds 1 BLAH @ $200
> Assets:Investments:Cash
>
> I'm trying to see current values for all commodities in terms of their
> monetary value at their current prices, something like this:
I don't know what the most elegant way is and hopefully someone else
will offer a clean solution, but I know of two approaches that work.
The first is based on an idea from Craig Earls from a few years ago
and uses automated transactions:
= expr (commodity == 'GOOG')
(Equities:GOOG) 1.000
= expr (commodity == 'BLAH')
(Equities:Blah) 1.000
ledger -f d bal equities -V
$1200 Equities
$200 Blah
$1000 GOOG
--------------------
$1200
What I do personally is to add a "Fund" metadata value and then use --pivot:
2018-12-09 * Bought GOOG
; Fund: GOOG
Assets:Investments:Funds 1 GOOG @ $1000
Assets:Investments:Cash
2018-12-09 * Bought BLAH
; Fund: BLAH
Assets:Investments:Funds 1 BLAH @ $200
Assets:Investments:Cash
ledger -f d bal fund --pivot Fund -V
$1200 Fund
$200 BLAH:Assets:Investments:Funds
$1000 GOOG:Assets:Investments:Funds
--------------------
$1200
--
Martin Michlmayr
https://www.cyrius.com/
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.