Given the following journal file:
P 2023-01-01 B 20A
P 2023-01-01 C 1B
2023-01-01
investment 1C @@ 20A
investment 4B @@ 80A
assets
P 2023-12-31 C 2B
If I want to get ROI "in units of B", I'm expecting to see something like this:
$ hledger -f /tmp/test.journal roi --inv investment --pnl income --value='end,B' -e2024
+---++------------+------------++---------------+----------+-------------+-----++--------++------------+----------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR || TWR/period | TWR/year |
+===++============+============++===============+==========+=============+=====++========++============+==========+
| 1 || 2023-01-01 | 2023-12-31 || 0 | 5B | 6B | 1B || 20.00% || 20.00% | 20.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------++------------+----------+
But instead I get an error Error: Amounts could not be converted to a single cost basis: ["2B","4B @@ 80A"] with a recommendation to add --cost.
Adding --cost helps remove the error message, but gives an incorrect result:
$ hledger -f /tmp/test.journal roi --inv investment --pnl income --value='end,B' -e2024 --cost
+---++------------+------------++---------------+----------+-------------+-----++-------++------------+----------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR || TWR/period | TWR/year |
+===++============+============++===============+==========+=============+=====++=======++============+==========+
| 1 || 2023-01-01 | 2023-12-31 || 0 | 5B | 5B | 0 || 0.00% || 0.00% | 0.00% |
+---++------------+------------++---------------+----------+-------------+-----++-------++------------+----------+
How should I change my query (or perhaps my journal) to see that 20% IRR?
Given the following journal file:
If I want to get ROI "in units of B", I'm expecting to see something like this:
But instead I get an error
Error: Amounts could not be converted to a single cost basis: ["2B","4B @@ 80A"]with a recommendation to add--cost.Adding
--costhelps remove the error message, but gives an incorrect result:How should I change my query (or perhaps my journal) to see that 20% IRR?