Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor
5 years ago

Asking for a customer. Is is possible to apply currency translation on data in the Stage ?

Originally posted by Henri Roest

7/12/2018

Asking for a customer. Is is possible to apply currency translation on data in the Stage ?

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Celvin Kattookaran

    I had to do this for my client.I'm using the FX rates stored in the cube and converting them to local currency.

    I've a currency column in my plan table.

     

    Dim entity As String = args.Line.Split(",")(4).Trim()

    Dim currency As String = args.Line.Split(",")(7).Trim()

    Dim entityID As Integer = BRApi.Finance.Members.GetMemberId(si, DimTypeId.Entity, entity)

    Dim locCurrency As String = BRApi.Finance.Entity.GetLocalCurrency(si,entityID).Name

    Dim wfTimeName As String = BRApi.Finance.Time.GetNameFromId(si,si.WorkflowClusterPk.TimeKey)

     

    Dim fxRatePkUsingNames As New FxRatePkUsingNames("AverageRate", wfTimeName, currency, locCurrency)

     

    If currency.XFEqualsIgnoreCase(locCurrency) Then

                   Return args.Value

    Else

                   Return  args.Value/BRApi.Finance.Data.GetStoredFxRate(si,fxRatePkUsingNames).Amount

    End If

     

     
    Value before conversion
     
     
    after
     
    Staging table and Cube will show the same data now.