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!30Views0likes1CommentGetDataBufferUsingFormula
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])")26Views0likes1CommentUD8 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 Software3KViews6likes4CommentsAutomatic 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?2.9KViews5likes6CommentsHow 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.389Views0likes6CommentsCustom 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 P196Views0likes9CommentsIf Cell Amount is Blank Confirmation Rule
Hello, I'm writing a confirmation rule that is a specific few cells are blank or if these cells are not 0 that the confirmation rule passes. I got the 2nd part to work fine, but when the cells are blank I'm having an issue. Can someone help me with my code and what I might be missing or need to change? Dim EntityName As String = api.Pov.Entity.Name.ToString Dim WFYear As Integer = api.Time.GetYearFromId(api.Pov.Time.MemberId) ' Retrieve amounts for each account Dim AccountPPEICSaleAmount As Decimal = api.Data.GetDataCell("Cb#Consol:C#Local:S#Actual:V#Periodic:A#0710:F#PPE_ICSale:O#BeforeAdj:I#None:U1#00:U2#DEF:U3#L_UNA:U4#None:U5#None:U6#None:U7#USGAAP_FORM:U8#None").cellAmount Dim AccountADICSaleAmount As Decimal = api.Data.GetDataCell("Cb#Consol:C#Local:S#Actual:V#Periodic:A#0771:F#AD_ICSale:O#BeforeAdj:I#None:U1#00:U2#DEF:U3#L_UNA:U4#None:U5#None:U6#None:U7#USGAAP_FORM:U8#None").cellAmount Dim AccountPPEICProceedAmount As Decimal = api.Data.GetDataCell("Cb#Consol:C#Local:S#Actual:V#Periodic:A#0710:F#PPE_ICProceed:O#BeforeAdj:I#None:U1#00:U2#DEF:U3#L_UNA:U4#None:U5#None:U6#None:U7#USGAAP_FORM:U8#None").cellAmount 'Check if data is real data If AccountPPEICSaleAmount = "" AndAlso AccountADICSaleAmount = "" AndAlso AccountPPEICProceedAmount = "" Then args.ConfirmationRuleArgs.DisplayValue = (AccountPPEICSaleAmount + AccountADICSaleAmount + AccountPPEICProceedAmount) Return True ' Check if all three amounts are non-zero ElseIf AccountPPEICSaleAmount <> 0 AndAlso AccountADICSaleAmount <> 0 AndAlso AccountPPEICProceedAmount <> 0 Then ' Set the DisplayValue to a meaningful string for reporting purposes args.ConfirmationRuleArgs.DisplayValue = (AccountPPEICSaleAmount + AccountADICSaleAmount + AccountPPEICProceedAmount) Return True Else ' Indicate which accounts are zero (optional for debugging) args.ConfirmationRuleArgs.DisplayValue = (AccountPPEICSaleAmount + AccountADICSaleAmount + AccountPPEICProceedAmount) End If Thanks, WillSolved56Views0likes2CommentsBusiness Rule: Copy data from one cube to another with different cube dimensions
Hello, I have following two cubes in onestream: Volumes Detail All the cube dimensions are the same except for UD1. For volumes, UD1 cube dimension is VintageDim and for detail its FunctionTotal. I am trying to copy data from "Volumes" cube to "Detail" Cube through a Business Rule. I am running this business rule from Data Management Step. The rule runs perfectly but it doesn't copy the data. I don't get any error too. Please can someone help to understand the issue? Public Sub CopyData() Try 'Define the source and target information Dim sourceCube As String = "Volumes" Dim targetCube As String = "Detail" Dim sourceScenario As String = api.Pov.Scenario.Name '1. Pull data from the source cube (Volumes) 'Using a formula to capture the desired data unit Dim sourceDb As DataBuffer = api.Data.GetDataBufferUsingFormula($"Cb#{sourceCube}:S#{sourceScenario}:A#Product_Sales") '2. Convert the data buffer to match the target cube's dimensionality 'This handles the automatic mapping of extended members between the cubes Dim convertedDb As DataBuffer = api.Data.ConvertDataBufferExtendedMembers(targetCube, sourceScenario, sourceDb) '3. Set the converted data into the target cube (Detail) Dim destInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("") api.Data.SetDataBuffer(convertedDb, destInfo) Catch ex As Exception brapi.ErrorLog.LogMessage(si, "EXCEPTION: " & ex.Message) Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub Thank you81Views0likes1CommentCreating FXRateType by BR
Is there a way to create a FXRateType from a Business rule? FXRate types (average rate, closing rate...) are used to set FX rates in addition to Time, source and destination currencies. In addition to default FXRate types, new ones can be added: Is it possible to create such FXRate types by business rule? Indeed, by business rule (with BRAPI.Finance.MemberAdmin.SaveMemberInfo), we can create a scenario, set parameters, set an existing FXRateType for P&L and for BS, but I've not found how to create a new FXRateType that could be used for this scenario.44Views0likes0CommentsCalculation Error "Error processing script: 'A#All = 0 * A#All"
I was running into issues clearing durable data prior to Clearing it so I calculated the data prior to the Clear statement so the data was "calculated", then ran the ClearCalculatedData stmt. It works fine for me, but I have admin access and it works fine for a select few users. But for the majority of users they receive the error "Error processing script: 'A#All = 0 * A#All". I can not easily test in Prod as my hands are tied as far as making security changes. In prod I have other users with the same set of security groups (just pointing to other entity WFs) and they do not receive the error. In our Dev environment I can set up a native user with the exact same security groups as a prod user that fails and I do not receive an error. As for it being an issue with data, I have an entity where 1 user can run it and another can not. And they have the same set of security groups. Does anyone have any thoughts on what is going on? I also thought that the ClearCalculatedData should have been able to clear it (durable data) with the Boolean set to true, but it doesn't. Does anyone have any thought on why the clear does not work w/o calculating the data prior to clearing it? I did see a note about the ClearCalculatedData that the final argument must be true to clkear any data with a storage type Durable. But I'm not exactly sure what this means - can someone clarify that statement for me? This is the code: This is the error:1.9KViews0likes6Comments