Forum Discussion

chris_rothermel's avatar
chris_rothermel
Contributor
2 years ago
Solved

api.Data.GetDataBufferUsingFormula filter by DataType or StorageType = IsRealData vs IsDerivedData

Is there a way to filter a DataBuffer on DataType or StorageType? I'm running a business rule in T#2023Q3.  This business rule gets a data buffer for an account.  I was expecting the data to be for...
  • chris_rothermel's avatar
    2 years ago

    Vielen Dank Christian Wetterwald für die schnelle Lösung dieses Problems.

    The solution is to simply adjust the View to Periodic and the other Q1 and Q2 data are not brought in.

    	Dim BSRCarveoutDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("RemoveZeros(V#Periodic:A#A_BSRCarveout:C#None)")

     

     

  • RobbSalzmann's avatar
    2 years ago

    Hi chris_rothermel  if you didn't want to change your View to Periodic, perhaps you can filter on the CellStatus Property of DataBufferCell to get only the data you want:

    Dim BSRCarveoutDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("RemoveZeros(A#A_BSRCarveout:C#None)")
    'Filter and select DataBufferCells with IsRealData status
    Dim realDataCells As Dictionary(Of DataBufferCellPK, DataBufferCell) = BSRCarveoutDataBuffer.DataBufferCells.Where(Function(cell) cell.Value.CellStatus.IsRealData)