Removezeros in getdatabuffer
Hi, We have a seeding rule that is copying zeros: sourceActualsBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate,S#Actual_Opco:U5#None,False, destinationBuffer) I am trying to change it so it does not include zeros, by applying the removezeros function: sourceActualsBuffer = api.Data.GetDataBuffer(DataApiScriptMethodType.Calculate,"RemoveZeros(S#Actual_Opco:U5#None)",False, destinationBuffer) When I do this, I get an error see attachmement. I tried to change the quotes RemoveZeros("S#Actual_Opco:U5#None") but then i get a different error when validating. Could not find anything in the reference on how to fix this. Anybody can help?Solved2.5KViews0likes3CommentsCall Assembly Business Rule from another Workspace in a Data Management Step
I'm looking to call a business rule that is located in a different workspace within Assemblies but am unsuccessful. The first screenshot below shows my DM step configuration. The business rule I'm trying to call is an out-of-the-box rule within the Financial Close solution. The second screenshot shows the workspace (namespace prefix = OFC), the assembly (RCM) and the business rule (DiscoverRecons). The third screenshot shows the tool tip when you hover over "Business Rules" on the DM step. I've attempted many variations of the yellow highlighted syntax, always returning an invalid business rule error. The fourth screenshot shows the out-of-the-box DM step I'm emulating. I used this to verify the parameters I'm passing in work which they do. I've ensured that both the current workspace and OFC workspaces are sharable and include the shared workspace names. Does anyone know the correct syntax to call this rule into my DM step?72Views0likes7CommentsIf Then Else Statement to return Annotation in UD8
Hello- Is there any reason why the below if , then, else statement is not working correctly? Val2 has data when I only return it in a test dynamic calc, but when incorporated into the below formula, it is reading a zero for Val2. Any help would be greatly appreciated:Solved22Views0likes2CommentsPerform a Translate within a Calculate when copying information.
In a calculation, I'm copying data from one scenario to another. I have no issues with the amounts in local currency, but with the USD currency I do, because it retains the same value as the scenario I'm copying to, instead of the value it should actually have. Dim TimeName As String = BRApi.Finance.Time.GetNameFromId(si, si.WorkflowClusterPk.TimeKey) Dim entity As String = api.Pov.Entity.Name Dim index As Integer = TimeName.indexOf("M") Dim monthNumber As String = TimeName.Substring(index + 1) '1 'api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,False,False,True) api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,True,True,True) 'BRapi.ErrorLog.LogMessage(si,"Time: " & api.Pov.Time.Name & " entity: " & entity & " currency:" & api.Pov.Cons.Name) 'If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) Then If api.Cons.IsLocalCurrencyForEntity() Then 'api.Data.Calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = RemoveZeros(FilterMembers(S#[Forecast " & TimeName & "],[A#Root.Base]))") api.Data.Calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = RemoveZeros(S#[Forecast " & TimeName & "])") api.Data.Translate(sourceDataBufferScript, destDataBufferScript, End If I use this code when consolidating the target scenario, so I'm not sure if I'm missing something in this section, since in theory the translation should happen automatically during consolidation. I appreciate any support you can give me.25Views0likes1CommentGet WF Status
Hello, In my BR, I need to incorporate logic that executes code based off the status of a separate WF Channel. E.g. I have 2 workflow channels and the first contains Workspace-->Import-->Validate--Load The second is simply Workspace. This second workspace has a button that kicks off a DM job that executes a BR. In the BR, the code needs to read the status of the first channel, and if it is not completed through process, execute specific code. Any ideas?23Views0likes1CommentRecurring journal with Auto Post
So im trying to create a rule that pulls selected journals forward than posts them automaticaly. I have my test journal pulling forward as expected but when im trying to post the journal in rule below its causing the rule to error. The line in question is, BRApi.Journals.Process.ExecutePost(si, journalObjectHeader.UniqueID) What am i missing it seems pretty straight forward? Imports System Imports System.Data Imports System.Data.Common Imports System.IO Imports System.Collections.Generic Imports System.Globalization Imports System.Linq Imports Microsoft.VisualBasic Imports System.Windows.Forms Imports OneStream.Shared.Common Imports OneStream.Shared.Wcf Imports OneStream.Shared.Engine Imports OneStream.Shared.Database Imports OneStream.Stage.Engine Imports OneStream.Stage.Database Imports OneStream.Finance.Engine Imports OneStream.Finance.Database Imports System.IO.Compression Namespace OneStream.BusinessRule.Extender.CA_JournalRecurring2 Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object Try Select Case args.FunctionType Case Is = ExtenderFunctionType.Unknown CopyJournal(si) Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep Case Is = ExtenderFunctionType.ExecuteExternalDimensionSource 'Add External Members Dim externalMembers As New List(Of NameValuePair) externalMembers.Add(New NameValuePair("YourMember1Name","YourMember1Value")) externalMembers.Add(New NameValuePair("YourMember2Name","YourMember2Value")) Return externalMembers End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function Private Sub CopyJournal(ByVal si As SessionInfo) Try 'retrieve the names of the workflow parameters and concatenate them together Dim profilePostfix As String = brapi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey).Name Dim scenarioPostfix As String = brapi.Finance.Members.GetMemberName(si,dimtype.Scenario.Id, si.WorkflowClusterPk.ScenarioKey) Dim timePostfix As String = brapi.Finance.Members.GetMemberName(si, dimtype.Time.Id, si.WorkflowClusterPk.TimeKey) Dim strPostfix As String = $"{profilePostfix}_{scenarioPostfix}_{timePostfix}" 'The name of the journal to copy Dim journalName As String ="Tax Accruals_Houston.journals_Actual_2011M2" Dim oldJournalObject As JournalEx = BRApi.Journals.Metadata.GetJournalOrTemplate(si, journalName) brapi.ErrorLog.LogMessage(si, journalName) 'Remove the postfix from the old journal name to get the name Dim strOldName As String = oldJournalObject.Header.Header.Name Dim oldProfileName As String = brapi.Workflow.Metadata.GetProfile(si,oldJournalObject.Header.Header.WorkflowProfileID).Name strOldName = strOldName.Remove(strOldName.IndexOf(oldProfileName)) brapi.ErrorLog.LogMessage(si, strOldName) 'create a copy of the journal header Dim journalObjectHeader As New JournalHeader(oldJournalObject.Header.Header) 'Update the required parameters journalObjectHeader.Name = $"RF_{strOldName}{strPostfix}" journalObjectHeader.Description = $"Roll Forward from {oldJournalObject.Header.Header.name}: {oldJournalObject.Header.Header.Description}" journalObjectHeader.UniqueID = Guid.NewGuid() journalObjectHeader.MemberIds.Scenario = si.WorkflowClusterPk.ScenarioKey journalObjectHeader.MemberIds.Time = si.WorkflowClusterPk.TimeKey journalObjectHeader.WorkflowProfileID = si.WorkflowClusterPk.ProfileKey ' Log the unique ID Of the journal before posting brapi.ErrorLog.LogMessage(si, $"Journal UniqueID: {journalObjectHeader.UniqueID}") 'Journal status as working journalObjectHeader.JournalStatus = JournalStatus.Working 'Create a copy of the journal line item using linq Dim journalObjectLineItems As list(Of JournalLineItem) = oldJournalObject.LineItems.Select(Function(x) New JournalLineItem(x.LineItem)).tolist 'Create a new journal object Dim journalObject As New Journal(journalObjectHeader, journalObjectLineItems) 'Save it BRApi.Journals.Metadata.SaveJournalOrTemplateUsingIds(si, journalObject, False, True) ' Post the journal using ExecutePost BRApi.Journals.Process.ExecutePost(si, journalObjectHeader.UniqueID) brapi.ErrorLog.LogMessage(si, $"Journal '{journalObjectHeader.Name}' posted successfully.") Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub151Views0likes2CommentsGet list of base members where text = in vb
I am having difficulties getting either the member ID or member name into a list using GetMembersUsingFilter. I have got this so far. Dim members As List(Of MemberInfo) = api.Members.GetMembersUsingFilter(api.Pov.AccountDim.DimPk, "A#BalanceSheet.Base.Where(Text2 = RF_Debt)", Nothing) However, this gives me neither the member ID or member name.Solved42Views0likes2CommentsHow to get the sum of multiple entities in a GetDataCell or in a Calculate
Hi Everyone. I want to get the sum of multiple entities, like in the example below, but for now I'm only getting errors or values with 0 'First option Dim strList As String = String.Join(", ", (From l In lstMI Select "" & l.Member.Name & "").ToArray()) Dim lstMI As List(Of MemberInfo) = BRapi.Finance.Members.GetMembersUsingFilter(si, api.Pov.EntityDim.DimPk, "E#Kazakhstan.Base.Where(Text1 = 'M_S_KAZAKHSTAN')", True) api.Data.GetDataCell("A#411000:E#Root.list([" & strList &"]):C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS").CellAmount 'Second Option api.Data.GetDataCell("A#411000:E#Kazakhstan.Base.Where(Text1 = 'M_S_KAZAKHSTAN'):C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS").CellAmount What I ultimately want to do is to get those values so I can change the following, so that the entity includes all those base entities that meet the filter, and I can get the correct value and use it in my Calculate. Dim DBICtry As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(A#RETBUYBACK:E#" & strEntTx3 & ":C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS + A#423100:E#" & strEntTx3 & ":C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS + A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS)") api.Data.FormulaVariables.SetDataBufferVariable("DBICtry",DBICtry,False) api.Data.Calculate("A#P_EBIPrct:O#Import:U1#D0000:U2#P0000:U3#LOCAL_DATA:U4#PJ00000 = Divide($DBICtry, A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U1#ALL_DEPARTMENTS:U2#INNER:U3#COUNTRY_RPT:U4#ALL_PROJECTS)") Thanks for your help and I appreciate the help.50Views0likes4CommentsUsing the Trailing3MonthAvg View Member in a Data Buffer Across Years
Hello, I was wondering if anyone has had any success using Trailing3MonthAvg View member within a data buffer when the trailing 3 months cross over years. When I run this for a period like June everything works great, but when I run this in Jan or Feb I get the object reference not set to an instance of an object error. When switching the View member to YTD everything works fine. Below is an example of the code. Thanks!! Dim filter1 As String = "U1#XXXXX.Base" Dim filter2 As String = "U6#XXXXXBase" Dim U2 As String = "XXXXX" Dim test1 As String= "Cb#XXXXXX:T#2023M1:A#Direct_HC:S#Actual:E#XXXXX:F#EndBal_Input:V#Trailing3MonthAvg:O#BeforeAdj:I#None:U3#Top:U4#Top:U5#Total_Adj_Alloc:U2#" _ & U2 & ":U7#Top:U8#None" Dim test As DataBuffer = api.Data.GetDataBufferUsingFormula( _ "RemoveZeros(FilterMembers(" & test1 & ", " & filter1 & ", " & filter2 & "))",,True)3.8KViews1like9CommentsSyntax to pull entity description where entity NOT the POV entity
Is there a syntax to lookup the description of an entity that is NOT the pov entity? In the example below the pov_entity is XXXXXXX_Canada, but the entity I want to pull a description from is 00250. I am writing a rule in a ud8 member to try to pull this. Thank you,Solved40Views0likes5Comments