11-22-2022 10:42 AM - last edited on 05-02-2023 09:52 AM by JackLacava
How does one write a calculation where the result needs to land at an intersection that includes C#Elimination. Ideally, I'd want to have a function such as:
Public Sub Book(ByVal si As SessionInfo, ByVal api As FinanceRulesApi, ByVal sourceCell As dataBufferCell, ByVal target As String, ByVal factor As Decimal)
And then call it as
Book(si,api,sourceCell,"U4#SOMECALC:C#Elimination",-0.3563523553)
Solved! Go to Solution.
11-24-2022 07:56 AM
I'm sorry, I don't think I understand - there are multiple problems with what you're trying to do.
11-22-2022 10:46 AM
so in my example, i'd want to replace U4# and C# with the provided members from sourceCell and put into a new variable (say targetCell) and execute api.Data.Calculate($"{targetCell} = sourceCell.CellAmount * factor")
11-24-2022 07:56 AM
I'm sorry, I don't think I understand - there are multiple problems with what you're trying to do.
11-28-2022 09:08 AM
Thank You Jack! As always great insight in your replies:
Going cross-dataunit (as you want to do, by targeting a specific Consolidation member) shouldn't be done in a Member Formula on Account/Flow/UD members, but rather in a Custom Calculation function in a Finance Business Rule.
Also, in order to accomplish this the cube calculation attributes need to be updated to be custom instead of standard. I already took the business rules class but do not recall going into how it is that the cube attributes affect the Finance BR calculations that can be executed against it. I will definitely read the book you prescribe: OneStream Finance Rules and Calculation Handbook by Jon Golembiewski
Thank You!
11-28-2022 06:17 AM
The [Book] function looks like a snippet from the FSK or some consultant solution, and not part of the OneStream foundation.
I assume you want to write to C#Elimination but from a calculation that is running on another C# member. You can't write to another data unit ("push" data), you can only "pull" in Finance Rules. So instead you can test if the calculation sequence is running on the C#Elimination member by doing this:
If api.Pov.Cons.MemberId = ConsMemberId.Elimination Then
Book(si,api, "C#[SomeOtherConsMember]:" & sourceCell, "U4:[SOMECALC]", someDecimal )
End If
11-28-2022 09:11 AM
Thanks for the suggestion. I'm trying to address data issues / eliminations using finance business rules during consolidation to generate the necessary eliminations. There are multiple sample codes online using the some variant of the book function that is correct.