Skip to main content
Newcomer
December 14, 2023

Extracting Annotations

  • December 14, 2023
  • 4 replies
  • 0 views

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.

4 replies

OneStream Employee
December 14, 2023

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.

OneStream Employee
December 14, 2023

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.

Expert
October 8, 2024

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.

OneStream Employee
October 8, 2024

It depends where you're storing the file and what you're reparsing it from, but if it's inside OneStream somewhere, I'd probably have a look at https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.fileio.textfieldparser?view=net-8.0

Newcomer
December 14, 2023

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

Newcomer
December 21, 2023

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.

GorkemSenol_0-1703157132556.png

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