Recent Discussions
DataBuffer Aligning of Dimensions
Hello, I have a question about aligning dimensions of a DataBuffer. I have an unallocated balance that is stored at a specific UD2 base member. This is shown in the log below: The goal is to multiply this amount (82.1097072) by a percentage at the same Account:UD1 combination, but the rate is stored at a U2#None, not at the same U2 as the unallocated percentage: The goal is for these data buffers to multiply and land at the specific U2# from the unallocated amount. (82.106*1.5219) However, since they are at different UD2s, they aren't going to multiply. Given that I need the specific UD2 detail, but the rates aren't stored at the specific UD2s, are there ways to manipulate the databuffer multiplication so this will occur at the detailed UD2? Dim Buffer As DataBuffer = RateBuffer * UnallocatedBuffer Thank you!JakeSteinberg7 hours agoNew Contributor III29Views0likes1CommentGetDataBufferUsingFormula
Can someone check if there's any mistake in the below 2 lines. I am unable to execute the BR Dim sourceBuff As DataBuffer Dim srcED As String = args.CustomCalculateArgs.NameValuePairs("sourceEffectiveDate") Dim selectedScenario = args.CustomCalculateArgs.NameValuePairs("selectedScenario") Dim dmTime = api.Pov.Time.Name Dim account = args.CustomCalculateArgs.NameValuePairs("account") sourceBuff = api.Data.GetDataBufferUsingFormula($"FilterMembers(T#{dmTime}:S#{selectedScenario}:U4#Approved_Status:U6#Total_Audit:U7#{srcED}, [A#{account}.Base])")jaideepk2618 hours agoNew Contributor26Views0likes1CommentUD8 Dynamic Calc - Retrieve Data From Another Application
Hello, I wanted to post this here since this came up at the Wave Conference in Vegas last week. Below is a snippet you can leverage to pull data from another application via a UD8 dynamic calc. This approach uses the CreateSessionInfoForAnotherApp BRApi to create a session in another application with the current user's credentials which ultimately enables you to execute any BRApi function (such as the GetDataCellUsingMemberScript BRApi) against another application in the same environment. This technique can be especially useful when looking to report on data that lives in two applications (in the same environment) in cube views and quick views. 'define the other application name you wish to connect to - this must be an app that lives within the same environment 'the user must also have access to the application to authenticate to it Dim otherAppName As String = "SomeOtherApp" 'create the session info to the other app and store it globally in memory Dim otherAppSeshInfo As SessionInfo = globals.GetObject("OtherAppSeshInfo") If (otherAppSeshInfo Is Nothing) Then otherAppSeshInfo = BRApi.Security.Authorization.CreateSessionInfoForAnotherApp(si, otherAppName, OpenAppResult.Success) globals.SetObject("OtherAppSeshInfo", otherAppSeshInfo) End If 'get the POV intersection from the CV and swap out the UD8 none member with the name of this UD8 reporting member Dim povMemberScript As String = api.Data.CreateMemberScriptBuilder(True, True, True, True).GetMemberScript().Replace("U8#GetDataFromAnotherApp", "U8#None") 'return the POV cell amount from the other application Return BRApi.Finance.Data.GetDataCellUsingMemberScript(otherAppSeshInfo, api.Pov.Cube.Name, povMemberScript).DataCellEx.DataCell.CellAmount Regards, Nick Kroppe Advanced Application Solutions OneStream SoftwareNickKroppe1 day agoOneStream Employee3KViews6likes4CommentsAutomatic addition of FX Rate Types
Hi All, I am trying to automate addition of FX Rate Types on a button click with some logic. Inserting values into FxRateType and AuditFxRateType using the below code snippet ------------------------------------ Public Sub AddCurrentFXRate(ByVal si As SessionInfo, ByVal api As Object, ByVal sCurrentOpsName As String, ByVal dt As DataTable) Dim dbConnApp As DBConnInfo = BRAPi.Database.CreateApplicationDbConnInfo(si) Try Dim sSQL As New Text.StringBuilder Dim sFXRateTypeGuid As String = Guid.NewGuid.ToString sSQL.AppendLine("INSERT INTO FxRateType (UniqueID, Name, Description, AccessGroupUniqueID, MaintenanceGroupUniqueID, XmlData) VALUES ('" & sFXRateTypeGuid & "', '" & sCurrentOpsName & "', '" & sCurrentOpsName & "', '" & dt.Rows(0)("AccessGroupUniqueID").ToString & "', '" & dt.Rows(0)("MaintenanceGroupUniqueID").ToString & "', ' ')") sSQL.AppendLine("INSERT INTO AuditFxRateType (AuditGuid, AuditSeqId, AuditUser, AuditTime, AuditInsUpdateDel, UniqueID, Name, Description, AccessGroupUniqueID, MaintenanceGroupUniqueID, XmlData) VALUES ('" & Guid.NewGuid.ToString & "', '1', '" & BRApi.Security.Authorization.GetUser(si, si.AuthToken.UserName).User.Name & "', '" & DateTime.Now & "', '0', '" & sFXRateTypeGuid & "', '" & sCurrentOpsName & "', '" & sCurrentOpsName & "', '" & dt.Rows(0)("AccessGroupUniqueID").ToString & "', '" & dt.Rows(0)("MaintenanceGroupUniqueID").ToString & "', ' ')") Using dbConnApp dbConnApp.BeginTrans() BRAPi.Database.ExecuteSql(dbConnApp, sSQL.tostring, False) dbConnApp.CommitTrans() End Using Catch ex As Exception dbConnApp.Dispose() Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub ------------------------------------ The values get added into the tables fine, but the newly added rate type does not show in FX Rates interface even after refreshing the application. Would someone please guide what I am missing here?NidhiMangtani5 days agoContributor III2.9KViews5likes6CommentsEnforce Constraints on Data Table. Failed to enable constraints. One or more rows contain values.
I am trying to return a SQL query in a Data table inside the business rule. But I am Getting the issue: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I tried to remove the constraint. Maybe I am doing it incorrectly or it is not possible. Dim sql As New Text.StringBuilder sql.AppendLine("Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, ") sql.AppendLine("COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, ") sql.AppendLine("COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, ") sql.AppendLine("COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, ") '''''''''QUERY Continues as below SQL CODE. Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) Dim ds As New DataSet ds.Tables.Clear() ds.EnforceConstraints = False Dim dt As DataTable = ds.Tables.Add() ' error comes when executing next line dt = BRApi.Database.ExecuteSql(dbConnApp, sql.ToString, False) Dim Count As Integer = dt.Constraints.Count BRApi.ErrorLog.LogMessage(si, "Count: here2") Return dt End Using The SQL query generates a table in a Data Adapter dashboard component. But the rule fails as the Data table does not enforce constraints through data coming from SQL. The SQL query: Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, COALESCE(S.WFTimeName,O.WFTimeName,W.WFTimeName) WFTimeName, COALESCE(NULLIF(O.JobTitle,''),W.JobTitle) JobTitle, COALESCE(NULLIF(O.LastName,''), W.LastName) LastName, COALESCE(NULLIF(O.FirstName,''), W.FirstName) FirstName, COALESCE(O.Wage,W.Wage) Wage, COALESCE(O.Bonus,W.Bonus) Bonus, COALESCE(O.FTE,W.FTE) FTE, COALESCE(O.GradeLevel,W.GradeLevel) GradeLevel, COALESCE(S.Status,O.Status,W.Status) Status, COALESCE(O.HireDate ,W.HireDate ) HireDate, COALESCE(O.HirePeriod,W.HirePeriod) HirePeriod, COALESCE(O.TermDate,W.TermDate) TermDate, COALESCE(O.TermPeriod,W.TermPeriod) TermPeriod, COALESCE(O.BirthDate,W.BirthDate) BirthDate, DATEDIFF(month, '1/1/2024', IIF(CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101))) +1 As OutPeriod, COALESCE(S.OutCode,O.OutCode,W.OutCode) OutCode, DATEDIFF(month, '1/1/2024',IIF(CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101))) +1 As InPeriod, COALESCE(NULLIF(NULLIF(S.Entity,'None'),''),NULLIF(NULLIF(O.Entity,'None'),''),W.Entity) Entity, COALESCE(NULLIF(NULLIF(S.Code1,'None'),''),NULLIF(NULLIF(O.Code1,'None'),''), W.Code1) Code1, COALESCE(NULLIF(O.Code2,'None'), W.Code2) Code2, COALESCE(NULLIF(O.Code3,''), W.Code3) Code3, COALESCE(NULLIF(O.Code4,''), W.Code4) Code4, COALESCE(NULLIF(O.Code5,''), W.Code5) Code5, COALESCE(NULLIF(O.Code6,''), W.Code6) Code6, COALESCE(NULLIF(O.Code7,''), W.Code6) Code7, COALESCE(NULLIF(O.Code6,''), W.Code6) Code8, COALESCE(NULLIF(O.Code6,''), W.Code6) Code9, COALESCE(NULLIF(O.Code6,''), W.Code6) Code10, COALESCE(O.NCode1, W.NCode1) NCode1, COALESCE(O.NCode2, W.NCode2) NCode2, COALESCE(O.NCode3, W.NCode3) NCode3, COALESCE(O.NCode4, W.NCode4) NCode4, COALESCE(O.NCode5, W.NCode5) NCode5, COALESCE(O.NCode6, W.NCode6) NCode6, COALESCE(O.NCode7, W.NCode7) NCode7, COALESCE(O.NCode8, W.NCode8) NCode8, COALESCE(O.DCode1, W.DCode1) DCode1, COALESCE(O.DCode2, W.DCode2) DCode2, COALESCE(O.DCode3, W.DCode3) DCode3, COALESCE(O.DCode4, W.DCode4) DCode4, COALESCE(NULLIF(O.Annot1,''),W.Annot1) Annot1, IIF(COALESCE(S.Status,O.Status,W.Status) = 'Workday','Workday', 'People Register') As Annot2, XFW_PLP_CalcPlanDetail.CalcPlanDetailID As DetailID, XFW_PLP_CalcPlanDetail.FKClassID, XFW_PLP_CalcPlanDetail.Description, XFW_PLP_CalcPlanDetail.WeightOrCount, XFW_PLP_CalcPlanDetail.PeriodDivisor, XFW_PLP_CalcPlanDetail.PeriodFilter, XFW_PLP_CalcPlanDetail.Condition, XFW_PLP_CalcPlanDetail.EntityOverride, XFW_PLP_CalcPlanDetail.FlowOverride, XFW_PLP_CalcPlanDetail.ICOverride, XFW_PLP_CalcPlanDetail.UD1Override, XFW_PLP_CalcPlanDetail.UD2Override, XFW_PLP_CalcPlanDetail.UD3Override, XFW_PLP_CalcPlanDetail.UD4Override, XFW_PLP_CalcPlanDetail.UD5Override, XFW_PLP_CalcPlanDetail.UD6Override, XFW_PLP_CalcPlanDetail.UD7Override, XFW_PLP_CalcPlanDetail.UD8Override, XFW_PLP_CalcPlanDetail.Sequence From (Select * from XFW_PLP_Register where status='Workday' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024' ) W FULL OUTER JOIN (Select * from XFW_PLP_Register where Status = 'OneStream' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') O On O.RegisterID = W.RegisterID LEFT OUTER JOIN (Select * from XFW_PLP_Register where Status = 'Split' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') S On S.RegisterID = W.RegisterID CROSS Join XFW_PLP_CalcPlanDetail Where ( XFW_PLP_CalcPlanDetail.FKCalcPlanID = '01_ACTIVE_UK' And XFW_PLP_CalcPlanDetail.FKWFProfileName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFScenarioName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFTimeName = 'PlanTemplate' ) Order By RegisterID,RegisterIDInstance,XFW_PLP_CalcPlanDetail.CalcPlanDetailID, XFW_PLP_CalcPlanDetail.SequenceNikpowar9727 days agoContributor7.3KViews0likes19CommentsHow do I clean a scenario before copying data from another scenario? in the member formula.
Hi Everyone. I want to copy the information from one scenario to another. Currently, I’m using the member formula of the target scenario to transfer the data. However, I first apply a calculate to set the values to zero, followed by a clecarcalculateddata to properly remove the existing information. The issue is that after this step, the copy process doesn’t execute, and the scenario remains with zero values. My code is as follows: api.Data.calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = 0*(S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE)",True) api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,True,True,True) Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE") '' Create new Databuffer for the results Dim resultDataBuffer As New DataBuffer 'Base Entity at Local If Not api.Entity.HasChildren And api.Cons.IsLocalCurrencyForEntity() Then BRapi.ErrorLog.LogMessage(si,"Validate 1") ' Get Databuffer from the account and scenario Dim sourceDataBuffer As DataBuffer = api.data.GetDataBufferUsingFormula("RemoveZeros(FilterMembers(S#[Forecast " & TimeName & "],[A#Root.Base]))", , False) ' Verificar si hay celdas con datos If sourceDataBuffer.DataBufferCells.Count > 0 Then BRapi.ErrorLog.LogMessage(si,"Validate 2") For Each sourceCell As DataBufferCell In sourceDataBuffer.DataBufferCells.Values If (Not sourceCell.CellStatus.IsNoData) And (sourceCell.CellAmount <> 0.0) Then BRapi.ErrorLog.LogMessage(si,"Validate 3") Dim resultCell As New DataBufferCell(sourceCell) resultCell.DataBufferCellPk.OriginId = DimConstants.Import resultDataBuffer.SetCell(si, resultCell, True) End If Next api.Data.SetDataBuffer(resultDataBuffer, destinationInfo,,,,,,,,,,,,,False) End If End If I would appreciate your help in understanding why the values are not being copied. The process is executed when I consolidate the information.Marco27 days agoContributor II389Views0likes6CommentsLosing Dynamic Parameters on Dashboard Refresh
Hello, I would be very grateful if someone could offer some direction on fixing the issue of dynamically generated parameters disappearing on a refresh action. When the dashboard initially loads, all of the dynamic parameters render as expect. I have an extender service setting the count of parameters to 2 for each param type (Debits,Credits). These work off two stored member list parameters, par_DebitList and par_CreditList. When the dashboard is refreshed, I lose the _dynamic_2 even though the parameter count is still 2. Public Function GetDynamicParametersForDynamicComponent( _ ByVal si As SessionInfo, ByVal api As IWsasDynamicDashboardsApiV800, ByVal workspace As DashboardWorkspace, ByVal maintUnit As DashboardMaintUnit, ByVal dynamicComponentEx As WsDynamicComponentEx, ByVal customSubstVarsAlreadyResolved As Dictionary(Of String, String)) _ As WsDynamicParameterCollection Implements IWsasDynamicDashboardsV800.GetDynamicParametersForDynamicComponent Try If api Is Nothing Then Return Nothing Dim CompName As String = dynamicComponentEx.DynamicComponent.Component.Name If CompName.Contains("CBX_Credits") Or CompName.Contains("CBX_Debits") Then Dim params As WsDynamicParameterCollection = api.GetDynamicParametersForDynamicComponent( _ si,workspace,dynamicComponentEx,String.empty,Nothing,tristatebool.TrueValue,WsDynamicItemStateType.MinimalWithTemplateParameters) Dim paramname As String = Nothing If CompName.Contains("CBX_Credits") Then paramname = "par_CreditList" Else paramname = "par_DebitList" End If Dim ParamComp As WsDynamicCompParamMemberEx = params.GetParameterUsingBasedOnName(paramname) Return params Else Return api.GetDynamicParametersForDynamicComponent(si, workspace, dynamicComponentEx, String.Empty, Nothing, TriStateBool.TrueValue, WsDynamicItemStateType.MinimalWithTemplateParameters) End If Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function This is my setting on the combo box: When refreshing the dashboard, all the components render, but just the parameters are lost. When loading the dashboard, GetDynamicParametersForDynamicComponent executes 8 times, while on a refresh it is only executing 6 times. Would appreciate any guidance on this. Thanks!BenEppel1 month agoContributor280Views0likes7CommentsHelp with event handlers
Hi I am trying to understand the event handlers to see if we can leverage them to improve user experience and put some controls around recurring issues. But the documentation is not helping. I think I figured the events in general and when they execute but can someone please explain the purpose of "Is Before Event", "Can Cancel", and "args.Inputs(x)" Thank you in advance, PMSolvedMikki1 month agoNew Contributor III192Views0likes3CommentsCustom Consolidation
Hi, I have a requirement from business that, want to restrict the roll-up in the entity dimension. for ex: i have Top entity, and all the members underneath are rolling up to Top, but i want to restrict one entity (ex: entity A) not to roll up for particular users which are part of group A. So, when Group A users retrieve the data at Top entity, he/she should see the total number except restricted entity(entity A) and all other can see the total numbers including entity A at Top. is there any way to restrict the roll-ups based on security. Thanks in Advance. any suggestions please, Appreciate your help. Thanks Satish PSatish1 month agoNew Contributor II195Views0likes9Comments