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 just the current period (T#2023Q3) which it does however it also brings quarters Q2 and Q1 which I was not expecting! I don't want this "IsDerrivedData" brought into my data buffer. How can I filter it out?
' ƒ WOW! - As we advance the Time we bring in the current and all prior periods. So 2023Q3 brings in data for Q3 AND Q2 AND Q2!
' Filtering by time doesn't work "RemoveZeros(T#2023Q3:A#A_BSRCarveout:C#None)"; IsDerrivedData, StoredByNoActivity dragged in, why?!?!
Dim BSRCarveoutDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("RemoveZeros(A#A_BSRCarveout:C#None)")
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)")
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)