Forum Discussion
- OSAdminValued ContributorOriginally posted by Eric Osmanski
For everyone following this, here is code to seed Actuals to FC when it is extended (FC at a higher level):
Dim ud2NoneID As Integer
If api.Pov.Cube.Name.XFEqualsIgnoreCase(""z_SuperCubeCOR"") Then
Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("""")
Dim sourceScript As String = ""Cb#z_SubCubeACOR:U2#Top""
Dim sourceDataBuffer As DataBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate, sourceScript, destinationInfo)
If Not sourceDataBuffer Is Nothing Then
Dim destDataBuffer As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""z_SubCubeACOR"", api.Pov.Scenario.Name, sourceDataBuffer)
Dim resultDataBuffer As New DataBuffer()
ud2NoneID = api.Members.GetMember(DimType.UD2.Id, ""None"").MemberId
For Each cell As DataBufferCell In destDataBuffer.DataBufferCells.Values
If (Not cell.CellStatus.IsNoData) Then
Cell.DataBufferCellPk.UD2Id = ud2NoneID
resultDataBuffer.SetCell(api.SI, cell, True)
End If
Next
api.Data.SetDataBuffer(resultDataBuffer, destinationInfo)
End If
End If
The dimensions are the same between the two scenarios except the Account dimension. Forecast accounts are at a higher level than Actual so that parent accounts in the Actual dimension are base in Forecast. Pretty standard. The data buffers get populated, but the converted data buffer still has the detailed accounts.
Can you change this Dim convertedDbf As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""CorpSGA"",scenario,sourceDbf)"" to Dim convertedDbf As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""CorpSGA"",""Actual"",sourceDbf)" - OSAdminValued ContributorOriginally posted by Eric Osmanski
For everyone following this, here is code to seed Actuals to FC when it is extended (FC at a higher level):
Dim ud2NoneID As Integer
If api.Pov.Cube.Name.XFEqualsIgnoreCase(""z_SuperCubeCOR"") Then
Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("""")
Dim sourceScript As String = ""Cb#z_SubCubeACOR:U2#Top""
Dim sourceDataBuffer As DataBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate, sourceScript, destinationInfo)
If Not sourceDataBuffer Is Nothing Then
Dim destDataBuffer As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""z_SubCubeACOR"", api.Pov.Scenario.Name, sourceDataBuffer)
Dim resultDataBuffer As New DataBuffer()
ud2NoneID = api.Members.GetMember(DimType.UD2.Id, ""None"").MemberId
For Each cell As DataBufferCell In destDataBuffer.DataBufferCells.Values
If (Not cell.CellStatus.IsNoData) Then
Cell.DataBufferCellPk.UD2Id = ud2NoneID
resultDataBuffer.SetCell(api.SI, cell, True)
End If
Next
api.Data.SetDataBuffer(resultDataBuffer, destinationInfo)
End If
End If
The dimensions are the same between the two scenarios except the Account dimension. Forecast accounts are at a higher level than Actual so that parent accounts in the Actual dimension are base in Forecast. Pretty standard. The data buffers get populated, but the converted data buffer still has the detailed accounts.
Can you change this?Dim convertedDbf As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""CorpSGA"",scenario,sourceDbf)"" to Dim convertedDbf As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(""CorpSGA"",""Actual"",sourceDbf)"
Related Content
- 2 years ago