Forum Discussion

Marco's avatar
Marco
Contributor II
5 hours ago

Perform a Translate within a Calculate when copying information.

In a calculation, I'm copying data from one scenario to another. I have no issues with the amounts in local currency, but with the USD currency I do, because it retains the same value as the scenario I'm copying to, instead of the value it should actually have.

Dim TimeName As String = BRApi.Finance.Time.GetNameFromId(si, si.WorkflowClusterPk.TimeKey)
Dim entity As String = api.Pov.Entity.Name
Dim index As Integer = TimeName.indexOf("M")
Dim monthNumber As String = TimeName.Substring(index + 1) '1
'api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,False,False,True)
api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,True,True,True)
'BRapi.ErrorLog.LogMessage(si,"Time: " & api.Pov.Time.Name & " entity: " & entity & " currency:" & api.Pov.Cons.Name)

'If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) Then
If api.Cons.IsLocalCurrencyForEntity() Then
	
	'api.Data.Calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = RemoveZeros(FilterMembers(S#[Forecast " & TimeName & "],[A#Root.Base]))")
	api.Data.Calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = RemoveZeros(S#[Forecast " & TimeName & "])")
	api.Data.Translate(sourceDataBufferScript, destDataBufferScript,
End If

I use this code when consolidating the target scenario, so I'm not sure if I'm missing something in this section, since in theory the translation should happen automatically during consolidation.
I appreciate any support you can give me.

No RepliesBe the first to reply