Forum Discussion

GorkemSenol's avatar
GorkemSenol
New Contributor III
12 months ago

Extracting Annotations

Hi all,

I'm trying to find a way to extract comments and text inputs using a data management job.

OS doesn't let me select V#VarianceExplanation member in the dataunit section.

Error processing Data Management Step 'ExportComments'. Non-numeric View member 'VarianceExplanation' cannot be used in data filter

Any help is appreciated.

  • GorkemSenol's avatar
    GorkemSenol
    New Contributor III

    Hi all, 

    Thanks for the help.

    I created the SQL and used left join to the member table to get the descriptions. Now I am able to get the data I need using a Table View.

    Only question I have now is regarding the parameters. I tried to use a parameter defined but it when I run the table view it does not give me a member dialog. Instead there is a textbox for the parameter.

    Is there a way to pass parameters directly to the Table View or do I need to create a dashboard for that?

  • Hello,

    Ify ou want just to extract annotations, in addition to querying SQL, there are some APIs to work with data attachments. You can start exploring this one:

    Dim objDataAttachmentList As DataAttachmentList = BRApi.Finance.Data.GetDataAttachments(si, memberScript, includeFileBytes, startRowIndex, pageSize). The last two params are optional.

    You can use member script to define your perimeter.

    The result object has propoerty Items which is a list of DataAttachment objects where you have the dimension member names, title, text, file if attached, etc. One of the properties of DataAttachment is AttachmentType.

    So you could call the API, get the list and use Linq to filter VarianceExplanation ones using that property

    Dim objDataAttachmentList As DataAttachmentList = BRApi.Finance.Data.GetDataAttachments(si, memberScript, includeFileBytes, startRowIndex, pageSize)

    Dim listVarianceExplanation AS List(Of DataAttachment) = objDataAttachmentList.Items().Where(Function(x) x.DataAttachmentType = DataAttachmentType.VarianceExplanation).ToList()

    Then you can operate with the list as you need.

    Please use code above as starting point.

    HTH

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    This is a bit of an awkward task in OneStream. You could go the SQL route as chul suggested, or you could just extract everything as CSV somewhere and then deal with the (likely easier) problem of re-parsing the file if necessary:

    brapi.Finance.Data.ExportCellTextToCsv(si, "C:\\OneStreamShare\\test.csv", "HoustonEntities", "E#Root.Base", "Actual", "T#2020.Base")

    Obviously replace the values there (including target file path) with what you need.

    • AndreaF's avatar
      AndreaF
      Contributor III

      JackLacavaAfter exporting the file using the command you suggested, how would I go about re-parsing it? I want to filter the file by the Account dimension to generate a version that includes the VarianceExplanation for a specific account.

  • chul's avatar
    chul
    Contributor III

    You're getting that error because OneStream doesn't consider any of the commentary View members as true data. So to do this you can write a SQL statement with no lock against the DataAttachment table within a business rule.