cancel
Showing results for 
Search instead for 
Did you mean: 

Query on annotation data copy

NidhiMangtani
Contributor II

Hi All,

I am aware of various options available for copying scenario data in OneStream. These options (data management or custom calculate) usually copy only periodic data across scenarios. Any idea how annotation data can be copied from sceanario1 to scenario2 in OneStream?

Any leads would be appreciated.

Thanks

Bharti

Thanks,
Bharti Paryani
1 ACCEPTED SOLUTION

Hi,

 

If you create a Finance Business Rule and under CustomCalculate you run this syntax, api.Data.SetDataAttachmentText(). That should copy your annotation, but you challenge will then be to make it more dynamic. Probably use sql to create a data table for data attachments.

 

PeterFu_0-1654176089060.png

 

Peter

 

View solution in original post

5 REPLIES 5

Mustafa_A
Contributor II

Hey @NidhiMangtani 

Have you tried changing you view to "annotation" and change your source/target scenario as per your requirement.

Mustafa_A_0-1654175736652.png

 

 

Yes we have tried this but it doesn't copy annotation data.

Thanks,
Bharti Paryani

Hi,

 

If you create a Finance Business Rule and under CustomCalculate you run this syntax, api.Data.SetDataAttachmentText(). That should copy your annotation, but you challenge will then be to make it more dynamic. Probably use sql to create a data table for data attachments.

 

PeterFu_0-1654176089060.png

 

Peter

 

Thanks Peter, will give this a try.

Thanks,
Bharti Paryani

TonyToniTone
Contributor

The Annotations or Commentary is not located in any of the Data Record tables.  The Annotation and Commentary are stored in a table called DataAttachment where each comment is stored with a unique ID.  Since the commentary is not directly stored in the Data Record tables, the Data Management Copy step using V#Annotation will not work through Data Management.  

Peter is on the right path using the api.Data.SetDataAttachmentText() function to "copy" the data.  You will need a SQL Statement to select the source data from the DataAttachment table to store in a temp table to then "copy" to another scenario using the SetDataAttachmentText() function.  The data will be stored in the same DataAttachment table.  Also, as Peter mentioned, some process like a Custom Calculate will have parameters to pass into the Custom Calc BR to execute in order to define what Scenario to "copy" to.  Example of SQL Statement:

'Get annotation data table sql statement
Dim sql As New Text.StringBuilder()
sql.AppendLine("SELECT * ")
sql.AppendLine("FROM DataAttachment ")
sql.AppendLine("WITH (NOLOCK) ")
sql.AppendLine("WHERE Time = '"& povTime & "' ")
sql.AppendLine("AND ")
sql.AppendLine("Scenario = '" & sourceScenario & "' ")
sql.AppendLine("AND ")
sql.AppendLine("Entity = '"& povEntity & "' ")
sql.AppendLine("AND ")
sql.AppendLine("Cons = '"& destinationCurrency & "' ")

 

Please sign in! NidhiMangtani