Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor
5 years ago

Does anyone have a trick for being able to show the exchange rates in a CV?

Originally posted by Kathryn Watkins

8/3/2018

Does anyone have a trick for being able to show the exchange rates in a CV? Not the currency name, but the actual individual rates.

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Eric Osmanski

    Create dynamic accounts which pull the rates. If you have an FX calc you should have the syntax. The source currency you can base on the POV C#. I can post something here when I get by a computer.
    Dim fxRateTypeName As String = api.FxRates.GetFxRateTypeForAssetLiability().Name 'Rate type for Balance Sheet accounts
    Dim timeId As Integer = api.Pov.Time.MemberId 'Time period being processed
    Dim sourceCurrencyId As Integer = api.Pov.Cons.MemberId 'POV currency
    Dim destCurrencyId As Integer = api.Members.GetMemberId(Dimtype.Consolidation.Id, ""USD"")'USD
    Dim closingRate As Decimal = api.FxRates.GetCalculatedFxRate(fxRateTypeName, timeId, sourceCurrencyId, destCurrencyId)
    Return closingRate
    Create a Dynamic Account, put that code in, and then whatever C# in the POV is it will return the associated Closing Rate to USD. I hardcoded the destination as USD in this example (because that's all I was required to show) but it could be made more dynamic for the destination currency if you have that need.