Data Buffer

Oscar
Contributor

Hi EveryOne!!!!

Dim resultDataBuffer As DataBuffer = New DataBuffer
Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("")
Dim dataBuffSource As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(F#myF,A#XYZ.Base)")

For Each sourceCell As DataBufferCell In dataBuffSource.DataBufferCells.Values

BRApi.ErrorLog.LogMessage(si,$">> {sourceCell.GetAccountName(api).ToString} {sourceCell.GetFlowName(api).ToString}" )

Executing the code above I would expect to get base level accounts of node XYZ with Flow Member myF. However, I am getting the base level accounts but the Flow member is XFCommon. XFCommon is not even a Flow dimension member! Any ideas what I am doing wrong !? Thanks!

1 ACCEPTED SOLUTION

You have got an optional parameter not to change it to common ids.

Try this and see.

Dim dataBuffSource As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(F#myF,A#XYZ.Base)",,False)

View solution in original post

4 REPLIES 4

JackLacava
Community Manager
Community Manager

Hey Oscar,

XFCommon is what OneStream will use to mark dimension members that have been "fixed" in the DataBuffer, so that they can be used in calculations. That's because buffer math will only work where members match.

To explain, let's say you are trying to do api.Data.Calculate(F#OpeningBalance:U1#Something * F#None:U1#SomeDriver). OpeningBalance and None would never match, so no math would ever happen. Instead, OneStream defines cells in both buffers as pointing to F#XFCommon:U1#XFCommon, so now those dimensions will match for all cells and we can multiply any number they contain (where the other dimension members line up).

In your case, because you use FilterMembers with a single member over Flow, OneStream "fixes" that member in the resulting buffer, and the cells will be marked with XFCommon. The cells will still contain the values you expected. Does that make sense?

Hi !

I have used Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("S#Actual"), and I got the issue below (although S#Actual exist in the Scenario dimension)... what am I missing ? : 

Sergey_0-1682595186823.png

 

JackLacava
Community Manager
Community Manager

There might be a dimensionality mismatch between your source buffer and the target Scenario, or it might be something else. Look at the details of the error, turn on detailed logging, Force Calc with Logging etc etc

You have got an optional parameter not to change it to common ids.

Try this and see.

Dim dataBuffSource As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(F#myF,A#XYZ.Base)",,False)