Discuss formulas and business rules for your application.
Recently active
Hello, I setup a filter on a workflow profile calculation to run a data management job as long as the no calculate is the selected option. We have a Data Quality Event Handler Business rule to run this; however when I click on process cube, it's running the job twice at the same time. This is the example of what it's doing when I say it's running twice: Here it the code from the event handler: Namespace OneStream.BusinessRule.DataQualityEventHandler.DataQualityEventHandler Public Class MainClass '------------------------------------------------------------------------------------------------------------ 'Reference Code: DataQualityEventHandler ' 'Description: Event handler method that provides an opertunity to supplement a normal data quality ' action with your own custom functionality. ' (Example: email after ProcessCube or publish report to sharepoint after failed Confirmation). ' 'Usage: Executes when a Data Quality a
Hello everyone, I am experiencing an issue with a dynamic calculation rule in OneStream for a user-defined dimension (UD1) grouping entities. The rule works correctly for all Consolidation dimensions except for "Translated," where the data is not calculated or displayed at the UD1 level, even though the base entities have values for that member. Context: I have a dynamic calculation rule that sums the values of base entities grouped under a UD1. The rule’s logic is the following: Dim entity As String = api.Pov.Entity.Name Dim text5 As String = api.Entity.Text(5) Dim ud1 As String = api.Pov.UD1.Name Dim ud1Man As String = ud1.Substring(1,3) Dim parent As String = "P" & ud1Man Dim result As Decimal = 0.00 'Filter the entities by Text5 Dim entityPk As DimPk = api.Dimensions.GetDim("Entities").DimPk Dim entityList As List(Of MemberInfo) = api.Members.GetMembersUsingFilter(entityPk, "E#PL00.Base.Where(Text5 Contains '" & ud1 &"')", Nothing) 'If we deploy the entities with an
cHi All, good day. I'm using a database connection and it's working good: Dim dt As DataTable = Nothing Dim dbConnApp As DbConnInfo = BRApi.Database.CreateDbConnInfo(_si, Dblocation.External, "OneStream BI Blend")Dim stringSQL As String= "SELECT Entity,UD1_01,UD1_02,UD1_03,UD1_04,UD1_05,UD1_06,UD1_07,UD1_08,UD1_09,UD1_10,UD1_11,UD1_12,UD1_13,UD1_14,UD1_15 from XFC_UD1sbyEnt where Entity = " & "'" & api.Pov.Entity.Name & "' ; "dt = BRapi.Database.ExecuteSql(dbConnApp, stringSQL.ToString, False) but in the error message log have a lot of messages that I need to close the connection Summary: Error in DbConnInfo.~DbConnInfo(). DbConnInfo should be used in a 'using' statement or Close() should be called explicitly. does someone know how should be the command for close the connection? Thanks in advance and best Regards. Mario Guerrero
I need to update the security on a scenario using a dashboard button, is this possible through a dashboard extender rule? Essentially a meeting will take place and certain scenarios will need to be locked down so no one can make changes besides the appropriate security group on the call. I will then need to change it back to the original security settings with a separate button once the meeting is over
Hello OneStream experts: Thank you for the helps in the past. I found this forum is very helpful. I feel the MultiplyUnbalanced function is very nice and wonder if it can take more than 2 components to multiply. They give an example: If I want to do A#UnbalancedMultiplication=A#60000 x A#41000:U2#Parts I can use the following: api.Data.Calculate("A#UnbalancedMultiplication = MultiplyUnbalanced(A#60000, A#41000:U2#Parts, U2#Parts)") But, if I want to do multiply three components A#UnbalancedMultiplication=A#60000 x A#41000:U2#Parts x A#51000:U2#Material how to use the MultiplyUnbalanced function? Thank you in advance for any answers.
Hi all Are there any key short cuts in the business rules editor? Cheers
Hi Everyone. What I want to achieve is to obtain the amount of three times in a single getdatacell. What I have is the following: Dim first As Decimal = api.Data.GetDataCell("S#[" & strScenario & "]:" & timesTest(0) & ":E#30801_30800:A#FINVOLUME:F#None:O#BeforeAdj:U1#D0000:U2#P0100:U3#LOCAL_DATA:U4#PJ00000").CellAmount The issue is that I need to use three different times, but I don’t want to create three variables to sum those values, and I also don’t want to do something like the following: 'Example Dim tot as Decimal = api.Data.GetDataCell("#Time1" + "#Time2" + "#Time3") So, I wanted to see if there is a way to put all the times together in one so that the sum is done internally, or if it can only be done as shown above. I hope you can explain the best method to achieve this.
Hi Team, I would like to fetch and update the Entity Relationship Properties for the Entity Dimension members via Business Rules.The below peace of code works fine for only when I pass the Actual and Budget but when i pass the other scenario Type like Scenariotype 1 to 8 I get the error Object is not set to an instance of an object.Dim Scenario As String = args.CustSubstVarsAlreadyResolved("Param_SecnarioType_EO_24")'The above value i get it from the combo box as delimited list Dim Scenarioid As Integer = BRApi.Finance.Members.GetMemberId(si,dimtype.Scenario.Id,Scenario)Dim MyScenarioTypeid As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si,Scenarioid)Dim Timefilter As String = args.CustSubstVarsAlreadyResolved("Param_Time_24")Dim Timeid As Integer = BRApi.Finance.Members.GetMemberId(si,dimtype.Time.Id,Timefilter)Can you please help me with the correct way to get the scenario Type.
I have created a literal value parameter for entity that I want to refer in my finance rules for calculation. Can someone share me a code where I can look up values from a parameter I set instead of running a E#Root.base or something. Running a E#Root.base where txt1='value' is not an option . Thanks
Has anyone had success taking a date, say 12/2/2024, and the cube name I assume, and converting it to a period like 2024M12?
Hi Everyone. What I want to do is change the value of: si.WorkflowClusterPk.ProfileKey What I want to change is the ProfileKey of a Profile that can obtain the value by name. I need to make this change to modify a process that relies solely on the information from this attribute. Therefore, I would be grateful for your assistance.
Hello,Does anyone know an effective way to alter the amount column of a table using a SQL script?Use case: the client is bringing in what they call "Production Downtime" to the system, which shows hours of downtime by plant based on a reason (attribute). Using a Dashboard Data Set rule, I created a SQL query to return specific results from the stage table based on Entity and Plant selections. This rule is linked to a data adapter and fed into the BI Viewer.In their BI Viewer report, it shows current Month vs PY Month. Since this data is coming in daily, when the user is looking at the current month, (today is Nov 21) the current month shows 21 days' worth of downtime data. They would like the PY Month to also represent 21 days of data.So, I would like to create a "ratio" variable that reads the current day of month and divides by the total days in month, and multiply the PY data by it. I created something similar in a UD8 calc:(SQL Is not my strong suit) how can I apply this "ratio" to
We are trying to build a one side match rule for AR TXM. Within our DS1, we have transactions that combine and net to zero. We are finding that the one side rule is matching transactions by the amount instead of first summing the group of transactions to zero, which is resulting in incorrect matches. Is there a way to match negative amounts to positive amounts of the same balance (i.e. absolute value, but then we still need the net to be an accurate zero). Is there a way to leave the "amount" field off of the definition page. Also, whenever we try to enter in a tolerance, we get an error message to select the tolerance type, but there is no option to do so on a one-side rule. We are having the same issue with the many to many rules where the rule is not summing up the transactions into one before executing match
Hi! New to Vb.Net here. Trying to write a UD8 formula which extracts the right 3 characters of an Entity member name, only when the member is a base member. Error message received says "'IsBase' is not a member of 'Member'." Anyone know how to make this work? If api.View.IsAnnotationType() Then 'Check if the member is a base member If api.Pov.Entity.IsBase Then 'Return the last three characters of the member name Dim membername As String = api.Pov.Entity.Name Dim lastThreeChars As String = Right(membername, 3) Return lastThreeChars Else 'Return a NoData Datacell if not a base member Return api.Data.CreateDataCellObject(0.0,True, False) End If Else ' Return a NoData Datacell if not an annotation type Return api.Data.CreateDataCellObject(0.0, True, False) End If
Hi Experts, I am working on TransformationEventHandler rule in which we need to read the first 4 columns of a text file that is being uploaded to Workflow Import so I can do some sanity checks and error out if they are not correct. Does anyone have sample code that reads the values of file? I checked everywhere but not much documentation on this. Also, I placed this code in "ParseSourceData" BREventOperationType. Not sure if this is correct or need to put under "ParseTransformationRules"? Thanks in advance, PM
Hi Everyone. I am trying to run a CustomCalculateBR in another BR, and I have the following for the variable namevaluepairs, but I would also like to pass parameters in this BR. I have been investigating but did not find a solution. Similarly, I would like to ask if passing with .base will work the same way as if it were in a step or not. I would appreciate it if you could help me. Dim mvp As New Dictionary(Of String,String) mvp.Add("Cube","HLFPLN") mvp.Add("Entity",strEntTx1) mvp.Add("Consolidation","Local") mvp.Add("Scenario","|WFScenario|") mvp.Add("Time","T#|!PLN_ParamFcstMths!|") mvp.Add("View","None") mvp.Add("Flow","None") mvp.Add("IC","None") mvp.Add("UD5","None") mvp.Add("UD6","None") mvp.Add("UD7","None") mvp.Add("UD8","None") mvp.Add("Parameters","test=ValueTest") BRApi.Finance.Calculate.ExecuteCustomCalculateBusinessRule(si,"PLN_ThreeMonths2","Test",mvp,CustomCalculateTimeType.MemberFilter)
We have a requirement to create reporting that utilizes the number of months since a company was acquired to perform math on specific columns of data. We would like to attach the acquisition date in a text field of an entity, and create a member formula for a statistical account that calculates the number of months between that acquisition date and whatever month the Point of View is referencing (we could convert the POV month to a specific date if necessary). Is this type of calculation possible within stored member formulas?
Hi all,I'm quite new to OS integration pieces and being struglled with a request from my client to load dimension members using their data lake, so the memebers would be updated automatically or by a scheduled event.The database is already configured at SIC and working fantastically well, however, I can't figure how to use it's features to load the metadata members to one of our UD dimensions.I read a lot of topics here in the forum, but couldn't find anything that matches my case.I already tried to create a Extender BR, but I'm getting a "Object variable or With block variable not set" error message when running the "api.Parser.ProcessSQLQuery" function. Not sure if I'm doing something extremely wrong, so I"m assuming that this part of the api must be used only within Connector BR's.I also trie to create a connector rule to do the job, but when setting it up at the dimension property, nothing happened (not sure if I missed something here).Any help on this will be really appreciated!Re
I have some business rules that need to identify which environment the BR is running in. This is because they does different things in each environment. In one BR i want the process to run in Prod but not QA or Dev, in another i want to copy extract files to an external shared folder which is different for each environment. I was thinking of using a dashboard parameter but if after a Prod to Dev/QA refresh i forget to change the value of the parameter, the BR will copy the files to the Prod external folder and i don't want that to happen. this is why i am trying to find a way to identify the environment without relying on the value in a parameter. Any thoughts? Have a great day! Bill
Hi - The below if condition is not working if the cube is multi cube, it works with Single cube? Any Idea why If api.Entity.OwnershipType().ToString.XFEqualsIgnoreCase("Holding") Then
Hi Everyone. I would like to know how I can perform a setdatacell on an entity that is not in my Data Management configuration. I obtain the value of the entity from Text 1 of my entity assigned to the POV, but it does not allow me to apply a setdatacell or a calculate to assign a new value to that entity. Therefore, I would like to know how I can achieve this. My Data management configuration: The example code I am using: Dim strEntity As String = api.Pov.Entity.Name Dim strScenario As String = api.Pov.Scenario.Name Dim strTime As String = api.Pov.Time.Name Dim povEntityId As Integer = api.Pov.Entity.MemberId Dim strEntTx1 As String = api.Entity.Text(povEntityId, 1) 'setdatacell api.Data.SetDataCell("S#[" & strScenario & "]:T#" & strTime & ":E#" & strEntTx1 & ":A#S_ConvFactorInner:O#BeforeAdj:U1#D0000:U2#P0000:U3#LOCAL_DATA:U4#PJ00000:U5#None:U6#None:U7#None:U8#None",totAll,False,True) 'Data.Calculate api.Data.Calculate("Cb#HLFPLN:S#[" & strScenario &am
Hey Guys,I was writing a rule to update a member description and text 1 field of the same member. I was able to update the member description, but can anyone help me with the text 1 field?Please find the code below which I am using to update the description..Dim SelectUD4 As String = args.NameValuePairs.XFGetValue("Param1")Dim NewDescriptionUD4 As String = args.NameValuePairs.XFGetValue("Param2")Dim UD4TextField As String = args.NameValuePairs.XFGetValue("Param3") BRApi.ErrorLog.LogMessage(si,UD4TextField) Dim member As Member = BRApi.Finance.Members.GetMember(Si,dimtype.UD4.Id,SelectUD4)If member Is Nothing Then Throw New Exception("Selected UD4 member not found")End IfDim newmember As New WritableMember(member)newmember.Description= NewDescriptionUD4newmemberbrapi.Finance.MemberAdmin.SaveMemberInfo(si, True, newmember, False, Nothing, False, Nothing, False)Any help would be appreciated.
Today, a customer asked me: Where do stored calculations store data? api.Data.Calculate If Statements In stored calculations, If Statements are helpful to specify that a formula is only required to execute on specific Data Units, as shown in the image below. If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) contains two logical operators (And and Not). Due to the AND operator, the statement api.Data.Calculate("S#Forecast = S#Actual") between Then and End If will only run if both of the following are true: The Entity is a Base-level Entity Member, i.e.: does NOT have Children (Not api.Entity.HasChildren()) The Consolidation Member is Local indicating the Entity Member's local currency (api.Cons.IsLocalCurrencyForEntity()) The statement api.Data.Calculate("S#Forecast = S#Actual") will copy the S#Actual data buffer to the S#Forecast data buffer. The If...End If
I am unsuccessfully trying to write an expression to utilize a Text Field as a filter in a business rule:api.Data.Calculate("U4#Target = U4#Source*-1","A#IncomeStatement.Base",,,,,,"U3#UserDefined.Base.Where(Text1 = 'Filter')") Is this syntax possible, or is there another way that I can write this to ensure that it is only being written when Text Field 1 for UD3 is equal to "Filter?"Additionally, is it possible to attach this to a transformation rule as a complex expression as opposed to needing to run it through Data Management after loading data?
We are trying to temporarily disable the Write access on a scenario to Everyone during a long DM sequence. We were able to find the ManageDataGroup under Scenario Properties, however, we could not find anything for ReadWriteDataGroup, which is a XMLConstants based on the API reference. Any help appreciated!
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.