Forum Discussion

gkeushkerian's avatar
gkeushkerian
New Contributor II
2 years ago

Custom Translation for FX Scenario - Help

Hello, I am trying to create a FX Scenario - Acutuals at Prior Year Rate. I know i can use Constant Year For FX Rate and assign the year from which OneStream will pick Actuals rate in this case. But ...
  • Henning's avatar
    Henning
    2 years ago

    In your case, all you need may just be this (have not tested it) in a Finance BR attached to the cube. Provided that you add some limitations to ensure this executes for the correct scenario only and still execute the default translation for your standard scenarios.

     

     

    Dim BudScenarioId As Integer = api.Members.GetMemberId(dimTypeId.Scenario, "BUD")
    Dim priorTimeId As Integer = api.Time.GetPriorYearPeriodId(api.Pov.Time.MemberPk.MemberId)
    
    Dim RateTypeCloBudPre As FxRateType = api.FxRates.GetFxRateTypeForAssetLiability(,BudScenarioId) 
    Dim cloRateBudPre As Decimal =  api.FxRates.GetCalculatedFxRate(RateTypeCloBudPre,priorTimeId)
    Dim RateTypeAvgBudPre As FxRateType = api.FxRates.GetFxRateTypeForRevenueExp(,BudScenarioId)
    Dim avgRateBudPre As Decimal =  api.FxRates.GetCalculatedFxRate(RateTypeAvgBudPre,priorTimeId)
    
    api.ExecuteDefaultTranslation(FxRuleType.Direct, avgRateBudPre, FxRuleType.Direct, cloRateBudPre)

     

     

    (Using S#BUD and prior year period as an example source for the FX rate)