Forum Discussion

Manjunathak's avatar
Manjunathak
New Contributor III
3 days ago

Periodic data copy from YTD scenario

i have blow code to copy the periodic values from YTD scenario but it didn't work

Dim sourceBuffer1a As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(S#" & sSourceForecast & ",V#PERIODIC,A#Top.Base,O#AdjInput)", DataApiScriptMethodType.Calculate, False, destination)
 Dim sourceBuffer1b As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(S#" & sSourceForecast & ",V#PERIODIC,A#Top.Base,O#Forms)", DataApiScriptMethodType.Calculate, False, destination)
                                
Dim sourceBuffer1 As DataBuffer = sourceBuffer1a + sourceBuffer1b
                                
                                If (Not sourceBuffer1 Is Nothing) Then
                                    Dim resultBuffer1 As New DataBuffer()
                                    For Each sourceCell As DataBufferCell In sourceBuffer1.DataBufferCells.Values
                                        Dim resultCell As New DataBufferCell(sourceCell)
                                        If sourceCell.CellStatus.StorageType=DataCellStorageType.Input _ 
                                            Or sourceCell.CellStatus.StorageType=DataCellStorageType.Journals _
                                            Or sourceCell.CellStatus.StorageType=DataCellStorageType.DurableCalculation Then
                                            resultCell.CellAmount = sourceCell.CellAmount
                                            resultBuffer1.SetCell(si, resultCell,True)
                                        End If
                                    Next
                                    api.Data.SetDataBuffer(resultBuffer1, destination,,,,,,,,,,,,,True)
                                End If 

 

is there any other code suggestion?

No RepliesBe the first to reply