How can I use a Business Rule to sort a Member List in alphabetical order?
Namespace OneStream.BusinessRule.Finance.XFR_MemberListAlphabetical Public Class MainClass '--------------------------------------------------------------------------------------------------- 'Reference Code: XFR_MemberListAlphabetical ' 'Description: Use a business rule to sort a member list in Alphabetical order ' 'Usage: This will put a member list of a dimension in Alphabetical order. ' Use the following on the cube view: ' E#Member.[Name of Business Rule, Name of List in Business Rule] ' e.g. E#Root.[XFR_MemberListAlphabetical, EntityAlphabetical] ' 'Created By: Robert Powers (put in XF Ref by John Von Allmen) ' 'Date Created: 5-24-2013 '--------------------------------------------------------------------------------------------------- Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, _ ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As Object Try 'This will put a member list of a dimension in Alphabetical order. 'Use the following on the cube view: ' E#Member.[Name of Business Rule, Name of List in Business Rule] ' e.g. E#Root.[XFR_MemberListAlphabetical, EntityAlphabetical] Dim Memberlistname As String = "Ent_Sort" Dim MemberListstart As String = "E#[Total GolfStream].base" Select Case api.FunctionType Case Is = FinanceFunctionType.MemberList If args.MemberListArgs.MemberListName = Memberlistname Then Dim objMemberListHeader = New MemberListHeader( _ args.MemberListArgs.MemberListName) 'Read the members Dim objMemberInfos As List(Of MemberInfo) = api.Members.GetMembersUsingFilter( _ args.MemberListArgs.DimPk, MemberListstart, Nothing) 'Sort the members Dim objMembers As List(Of Member) = Nothing If Not objMemberInfos Is Nothing Then objMembers = (From memberInfo In objMemberInfos _ Order By memberInfo.Member.Name Ascending _ Select memberInfo.Member).ToList() End If 'Return Return New MemberList(objMemberListHeader, objMembers) End If End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function End Class End Namespace18KViews6likes29CommentsRunning a Custom Calculation from a Business Rule with a MemberFilter for Time periods
We are trying to do a multi-year planning application. One requirement is the ability to calculate out-months into the next year of the plan. One solution that would be very useful is the ability to run a custom calculation with a variable set of time periods. "BRApi.Finance.Calculate.ExecuteCustomCalculateBusinessRule" has an enumerated argument of CustomCalculationTimeType. One of the enumerations is "MemberFilter", but there is no indication or documentation regarding how to supply the member filter for Time periods to execute for. Would anyone know how to implement this, or where I could find the details regarding its usage? Thanks in advance for any information or leads.10KViews1like16CommentsBusiness Rule debug
Hello, I'm new to Business Rule, and I'm struggling with the execution of a data management step with type "custom calculate". Currently, the execution of this script is giving me the message below : Error processing Data Management Step 'CC_FY2022_BUD'. Unable to execute Business Rule 'CopyData'. Invalid destination data unit in script 'A#Account1:C#Local:T#2022M1:S#Budget:U1#None:U3#T:U8#None:O#Import'. In the Data Management step, I have defined elements in the POV and Data Units, and "Data Units" elements seem to be taken into account correctly, but elements in the "POV" such as U2, U4, U5, U6, U7 elements that have been defined in the POV of data element task (hierarchy nodes) seem like is not considered in the calculation. So here are my questions: - What is the error message mentionned above actually saying ? - Are POC elements from the Data Element task taken into account in the Finance Business Rules ? - How do you efficiently debug a Business Rule ? Many thanks for your prompt answers ๐ Regards,Solved8.4KViews0likes7Commentshow to debug a business rule
An allocation business rule is not allocating the rates properly . Hence we would like to debug the business rule and also figure out which intersections are passed and what is the value and allocation rate used in allocation calculation . This allocation process involves a formula in UD7 member . Please advise how to see the messages used in api.logmessage . Should we need to create a dashboard to capture the messages that are logged while running the allocations. Again, we are looking for which members used and the value / rate used to allocate.Solved7.9KViews0likes11CommentsLog anything with JSON
I showed it at Wave and share it with all of you: when you use JSON to log, you can log anything, not just strings, you can log a Dictionary, a list, a MemberInfo, even a Databuffer. First, you need to import JSON, add these 2 rows at the top of your rule: Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Second, when you want to log, use JSON! Dim stringobj As String = JsonConvert.SerializeObject(lCenterInfo,Formatting.Indented) api.logmessage(lCenterInfo.Member.Name & ", lCenterInfo: " & stringobj) When you use ,Formatting.Indented, your log will be correctly formatted. Thanks to Matt Ha for enlightening me with JSON and RobbSalzmannfor sharing how to have the JSON string correctly formatted!7.9KViews13likes15CommentsCustom Translation for FX Scenario - Help
Hello, I am trying to create a FX Scenario - Acutuals at Prior Year Rate. I know i can use Constant Year For FX Rate and assign the year from which OneStream will pick Actuals rate in this case. But i dont want the user to be changing this property every year. My approach is to set "Translation Algorithm Type" to "Standard Using Business Rules For FX Rates" and create a custom translation for that specific scenario "Actuals at Prior Year Rate". Does anyone has the logic to translate the scenario using Actual Exchange rate tables switching one year back from the POV being translated?Solved7KViews0likes10CommentsDynamically Calculate Q1 total as sum of children
I have a dynamically calculated member formula. It is returning the wrong value for each Quarter, it should be the sum of the M1+M2+M2 ($1,614,441.60) and not be recalculated ($1,649,190.40). Is there a member property or formula examples that can help me resolve this issue. Thanks. Sample calc Drill down formula I tried setting a different formula on the quarter, but I get the error message โThe Dynamic Calc Member Formula is recursively calling itself:. Thanks,Solved7KViews0likes10CommentsSeeding forecast/Copying data to one entity
Hello, I am trying to set up a business rule that seeds the forecast from actuals to the forecast. This works easily when I am not using all entities to seed. However, I need to somehow take the actual data from each base entity and copy it all into 1 entity for the forecast. The client only needs to forecast at 1 entity but wants to include the actuals from every base. Is this possible to do in 1 rule? I know you can't have the entity on the left side of the calculation so I'm not sure how to solve. Thanks!Solved6.9KViews0likes9Comments