AndraEcxarcu
2 years agoNew Contributor II
FX rates retrieval – based on different source currencies
Hi everyone!
I have two entity hierarchies, one in currency EUR, and one in USD.
I need to create a cube view to retrieve the FX rates based on the parent’s currency. I’ve created an account, for example ClosingRate, as a DynamicCalc. I am using this formula to retrieve the rate:
api.FxRates.GetCalculatedFxRate(rateType, cubeId, timeId, sourceCurrId, destCurrId)
For the destination currency, it’s straightforward:
Dim destCurrId As Integer = api.Pov.Cons.MemberPk.MemberId
But I am unsure how to set the source currency as variable, I usually either set it to EUR, or USD.
Dim sourceCurrId As Integer = Currency.EUR.Id
Is there a way to get a parent’s currency? Or, I had another idea. To create a Text1 property at the level of each entity base member, to specify the Parent’s currency. I can retrieve it in the script as a string, but after that I don’t know how to get the Id.
Appreciate your help!
Thank you!