Forum Discussion

Marcus's avatar
Marcus
New Contributor II
13 days ago

Error saving a data buffer in Custom Calculate

Hi Community,

I try to save a simple data buffer within a Custom Calculate and receive a cryptic error message.

Dim sourceDataBuffer1 As New DataBuffer
sourceDataBuffer1 = api.Data.GetDataBufferUsingFormula("FilterMembers(C#Local,UD8#None)")
sourceDataBuffer1.LogDataBuffer(api,"sourceDataBuffer1",100)
Dim resultDataBuffer1 As DataBuffer = New DataBuffer()
For Each cell As DataBufferCell In sourceDataBuffer1.DataBufferCells.Values
	Dim sCell As New DataBufferCell(cell)
	api.LogMessage(sCell.DataBufferCellPk.GetMemberScript(api))
	resultDataBuffer1.SetCell(api.SI, sCell, True)
	Exit For
Next
resultDataBuffer1.LogDataBuffer(api,"resultDataBuffer1",100)
api.Data.SetDataBuffer(resultDataBuffer1, api.Data.GetExpressionDestinationInfo(String.Empty))

When I start the Custom Calculate from data management, I select a base entity and C#Local, scenario and time. The code will write a log with an usual POV of the cell without common members (line 7) and also log the restultdatabuffer1 with 1 cell (line 11).

But running into line 12 will cause the error. Summary and description only show "Error processing script ''." without further details.

Summary: Error processing script ''.


----------------------------------------
Description: Error processing script ''.


[...]


----------------------------------------
Exception Type: XFException
Thread Id: 249
Message: Error processing script ''.
Source code: line 0, method SetDataBuffer

----------------------------------------
Exception Type: XFException
Thread Id: 249
Source code: line 0, method SetDataBuffer

----------------------------------------
Exception Type: XFException
Thread Id: 249
Source code: line 0, method SetDataCells

----------------------------------------
Exception Type: XFException
Thread Id: 249
Source code: line 0, method SetDataCell

----------------------------------------
Exception Type: XFException
Thread Id: 249
Source code: line 0, method SetData

----------------------------------------
Exception Type: XFException
Thread Id: 249
Source code: line 0, method DetermineInputView

Within a regular calculation script, the data buffer will be saved correctly.

Any idea what the issues could be?

Thanks,

Marcus

  • Hi Henning,

    thanks. I'll keep that in mind and will provide an update, if I do further testing in the GolfStream application (as soon as there is some time). At the moment I'm just happy that it works on the client's application with setting the View member.

    Best,

    Marcus

  • Henning's avatar
    Henning
    Valued Contributor II

    Hi, I tested it in the OneStream Blueprint, and do not get such an error message. These are the DM settings I used:

    And this is the script. I just adjusted the rows 2 and 12 a little so that my test is limited to a single cell (row 2) and changed the destination account to that I can verify the results easily in a cube view.

    Dim sourceDataBuffer1 As New DataBuffer
    sourceDataBuffer1 = api.Data.GetDataBufferUsingFormula("FilterMembers(C#Local,V#YTD:A#40000:F#None:O#Import:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:UD8#None)")
    sourceDataBuffer1.LogDataBuffer(api,"sourceDataBuffer1",100)
    Dim resultDataBuffer1 As DataBuffer = New DataBuffer()
    For Each cell As DataBufferCell In sourceDataBuffer1.DataBufferCells.Values
    	Dim sCell As New DataBufferCell(cell)
    	api.LogMessage(sCell.DataBufferCellPk.GetMemberScript(api))
    	resultDataBuffer1.SetCell(api.SI, sCell, True)
    	Exit For
    Next
    resultDataBuffer1.LogDataBuffer(api,"resultDataBuffer1",100)
    api.Data.SetDataBuffer(resultDataBuffer1, api.Data.GetExpressionDestinationInfo("A#40010"))

    So yes, it should work. Maybe your DM step looks a little different(?).

     

    • Marcus's avatar
      Marcus
      New Contributor II

      Hi Henning,

      thanks a lot for your reply.

      Even if I restrict the data buffer to the POV of one cell (as you did in your script), the system behaves a little bit odd. With one specific POV, the calculation will sometimes run successfully, sometimes it will abort with the error message shown above. My DM step looks the same. However, if I add "YTD" as View in the DM step, the calculation doesn't seem to abort (I ran it a few times and for now it seems to work). Neither in that simple example nor in my initial rule which is a bit more complex and thus has a bigger result data buffer.

      Do you have any idea if the View needs to be fixed in the DM step? What impact will it have to set the View to "QTD" instead of "YTD"? Of course I will do a few more examples to figure out myself. But if there is any documentation of the behaviour, it will also be very helpful.

      Thanks & best regards,

      Marcus

      • Henning's avatar
        Henning
        Valued Contributor II

        Hi Marcus,

        Sorry, I do not recall having heard of such an issue. See if you can re-create this in BluePrint or Golfstream and then you can open a ticket to get to the bottom of it. But is this is not reproducable (in my very simple test, I had no issues), my guess is that this is due to a setting somewhere else. Maybe your scenario settings vary in your test, or are generally different from the ones in my test.  But that is just a guess, it would need more digging to get to the bottom of this (testing different settings, write all POV members into the error log,...). But first testing this in a Blueprint / Golfstream copy would help to verify whether that one can be reproduced or not.