Investment Studio > Expressions > Functions > Lookup > PORTFOLIO_CONVERTED_CURRENCY_PART

float portfolio_converted_currency_part(string currency_code, integer porfolio_index, date quote_date, boolean allow_old = FALSE)

Returns the total value on quote_date of all assets denominated in the currency specified by the currency_code and held in the portfolio identified by portfolio_index. The result is expressed in the portfolio currency, using the latest known currency conversion rate on quote_date.

If allow_old = FALSE, it's enough for the NAV of a single asset denominated in the specified currency to be unknown on quote_date for the function to fail with an #N/A error condition; allow_old = TRUE causes the first available, preceding asset NAV to be used instead.

Equivalent to (but more efficient than) the expression

=currency_convert(currency_code, portfolio_currency(portfolio_index), quote_date, portfolio_currency_part(currency_code, portfolio_index, quote_date, allow_old))

Portfolio indices are references to entries in Investment Studio's internal table of loaded portfolios. The table is automatically created and maintained behind the scene, and may be rearranged at any time. Portfolio indices should therefore never be specified using constants, but rather obtained through the interface methods provided by the object hosting the expression. See e.g. the discussion of lookup cells in Grid objects.

See also asset_currency, asset_nav, currency_convert, portfolio_currency, portfolio_currency_part.