Key Functions
The list below contains the most commonly used functions; however, this is not the complete list of all available functions. Download the OneStream API Overview Guide and OneStream API Details and Database Documentation from MarketPlace for detailed Business Rule engine background, an API guide and information on each database.
Account
Name |
Function |
Description |
---|---|---|
Account Type |
Public Function GetAccountType(MemberId As Integer) As AccountType |
Retrieves the Account type for the Member. |
Get Cell Account Type |
GetCellLevelAccountType |
Retrieves the Account type of the data cell based on its Account and flow settings. |
Get Formula Type |
Public Function GetFormulaType(MemberId As Integer) As FormulaType |
Returns the Formula Type if the Account is calculated. |
Get Plug Account |
Public Function GetPlugAccount(MemberId As Integer) As Member |
Retrieves the plug Account. |
Consolidation
Name |
Function |
Description |
---|---|---|
Calculate |
Public Sub Calculate(Formula As String, Optional onBeforeSetDataBuffer As BeforeSetDataBufferDelegate, Optional userState As Object, Optional arg0 As String, Optional arg1 As String, Optional arg2 As String, Optional arg3 As String, Optional arg4 As String, Optional arg5 As String, Optional arg6 As String, Optional arg7 As String) |
Executes a calculation for a specifically qualified Point of View. |
Execute Default Elimination |
Public Sub ExecuteDefaultElimination() |
Puts data into the Elimination Member of the Consolidation Dimension. |
Second Pass Eliminations |
Boolean argument for use in FinanceFunctionType.Calculate rules Dim bValue As Boolean = args.CalculateArgs.IsSecondPassEliminationCalc |
Used to calculate Data Units where Entity members are sibling members. Used to ensure source Entities are fully calculated at Eliminations |
Execute Default Share |
Public Sub ExecuteDefaultShare() |
Puts data into the Share Member of the Consolidation Dimension. |
Execute Default Translation |
Public Sub ExecuteDefaultTranslation(fxRuleTypeRevenueExp As FxRuleType, rateForRevenueExp As Decimal, fxRuleTypeAssetLiab As FxRuleType, rateForAssetLiab As Decimal) |
Calculates translation by bypassing consolidation and Business Rules. |
Is Consolidated |
Public Function IsConsolidated(MemberId As Integer) As TriStateBool |
Reveals if the Account is consolidated. |
Percent Consolidated |
Public Function PercentConsolidation(Optional EntityId As Integer, Optional ParentId As Integer, Optional varyByScenarioTypeId As Integer, Optional varyByTimeId As Integer) As Decimal |
The percent that an Entity contributes to a Relationship. |
Translated Currency Member |
Public Function IsForeignCurrencyForEntity(Optional EntityId As Integer, Optional consId As Integer) As Boolean |
Returns if the Consolidation Dimension Member is a translated currency Member. Used in translation rules. |
Data
Name |
Function |
Description |
---|---|---|
Allocation |
Use Journals for allocations |
Allocates data across Dimensions (Entities, User Defined Dimensions, Accounts, etc.) with configurable weighting, all through Journals that can be previewed, are generated, are posted and can be unposted. |
Convert Data Buffer |
api.Data.ConvertDataBuffer |
Modifies Dimension Members for the cells in a Data Buffer using mapping. |
Convert Data Buffer Extended Members |
api.Data.ConvertDataBufferExtendedMembers |
Automatically aggregates the data for extended Members in order to create data cells for Parent Members that are Base-Level Members in the destination Dimensions. This is used when copying data from a source Data Buffer created in another Cube or Scenario where one or more Dimensions have been extended. |
Get Data Buffer (working with Data Units) |
Public Function GetDataBuffer |
Retrieves a Data Unit's values during a consolidation, calculation, or translation. |
Get Data Buffer Using Formula |
Dim myDataBufer As DataBuffer = api.Data.GetDataBufferUsingFormula |
Use an entire math expression to calculate a final data buffer. |
Get Stored and Dynamically Calculated Values |
Public Function GetDataCell(Formula As |
Retrieves the data contained in an intersection of the Cube. If this is a dynamically calculated value, the calculation will be run on the fly before returning the value. |
Has Cell Notes or Data Attachments |
api.Data.GetDataCell(Formula, Parameters).CellStatus.HasAttachment |
Indicates whether the data cell has notes or file attachments. (Boolean) To retrieve the data attachment, query the appropriate Member of the View Dimension (Annotation, AuditComment, Footnote, VarianceExplanation, Assumptions). |
Has No Data |
api.Data.GetDataCell(Formula, Parameters).CellStatus.IsNoData |
Indicates if the cell has no data. (Boolean) |
Has Valid Data |
api.Data.GetDataCell(Formula,Parameters). |
Indicates if the data in a cell contains valid data that was derived from time logic. (Boolean) |
Get Data Buffer for Custom Share Calculation |
Public Function
myDataBuffer = api.Data. |
Use this function to assist in Custom Consolidations |
Get Data Buffer for Custom Elim Calculation |
Public Function
myDataBuffer = api.Data.
|
Use this function to assist in Custom Calculations |
Rounding |
Use the VB.NET function for rounding: |
Controls the level of rounding that is used. |
Set and Clear Data |
Public Sub SetDataCell(Memberscript As |
Sets data to a certain value. |
Show Cell Text |
Data Attachment Members in the View |
Use these View Members to display data attachment text within a Cube View, which can be used to edit text or display on Reports. |
Variance |
((A-B)/Abs(B)) |
Returns a Variance, but does not consider Account Type |
BetterWorse Difference |
Revenue Accounts:((A-B/Abs(B))) Expense Accounts: ((-1*A)-(-1*B)) |
Returns a Variance based on the Account Type. |
VariancePercent |
((A-B) / Abs(B)) * 100 |
Returns a Variance Percent but does not consider Account Type. |
BetterWorse Percent |
Revenue Accounts: ((A-B) / Abs(B)) * 100 Expense Accounts: (((-1 * A) – (-1 * B))/Abs(B)) |
Returns a Variance Percentage based on the Account Type. |
Unbalanced Math: Add, Subtract, Multiply, and Divide |
Api.Data.Calculate(“A#TargetAccount = |
Required to perform math using two Data Buffers where additional dimensionality must be specified for the second Data Buffer. |
Entity
Name |
Function |
Description |
---|---|---|
Default Currency |
Public Function GetLocalCurrency(Optional EntityId As Integer) As Currency |
Retrieves the assigned Currency for the Entity or Parent. |
Is Descendant |
Public Function IsDescendent(dimPk As DimPk, ancestorMemberId As Integer, descendentMemberId As Integer, dimDisplayOptions As DimDisplayOptions) As Boolean |
Returns if the Member is a Descendant of another Member. (Boolean) |
Is Intercompany |
Public Function IsIC(Optional EntityId As Integer) As Boolean |
Returns if the Entity or Account Member is an intercompany Member. |
Flow
Name |
Function |
Description |
---|---|---|
Switch Sign |
Public Function SwitchSign(MemberId As Integer) As Boolean |
Flow Dimension only. Responds as to whether credits are switched to debits for the specified Member for Revenue / Expense Accounts. (Boolean) |
Switch Type |
Public Function SwitchType(MemberId As Integer) As Boolean |
Flow Dimension only. Responds as to whether Account types are switched for the current or specified Member. This can drive translating this Member by a different FX Rate Type. (Boolean) |
FX
Name |
Function |
Description |
---|---|---|
Currency Type |
Public Function GetDefaultCurrencyId(Optional CubeId As Integer) As Integer |
Retrieves the currency type for the Cube or the Consolidation Dimension Member. |
Current Exchange Rate |
Public Function GetStoredFxRate(fxRateType As FxRateType, Optional timeId As Integer, Optional sourceCurrencyId As Integer, Optional destCurrencyId As Integer) As FxRate |
Retrieves the current exchange rate for the specified Entity. |
Exchange Rate Calculated |
Public Function GetCalculatedFxRate(fxRateType As FxRateType, timeId As Integer) As Decimal |
Calculates the exchange rate from the default currency to another. |
Get FX Rate Type for Asset / Liability Accounts |
Public Function GetFxRateTypeForAssetLiability(Optional CubeId As Integer, Optional ScenarioId As Integer) As FxRateType |
Retrieves the default Rate Type for Asset and Liability Accounts in this Cube or Scenario (overrides Cube value). |
Get FX Rate Type for Revenue/ Expense Accounts |
Public Function GetFxRateTypeForRevenueExp(Optional CubeId As Integer, Optional ScenarioId As Integer) As FxRateType |
Retrieves the default Rate Type for Revenue and Expense Accounts in this Cube or Scenario (overrides Cube value). |
Get FX Rule Type for Asset / Liability Accounts |
Public Function GetFxRuleTypeForAssetLiability(Optional CubeId As Integer, Optional ScenarioId As Integer) As FxRuleType |
Retrieves the default translation Rule Type for Asset and Liability Accounts in this Cube or Scenario (overrides Cube value). |
Get FX Rule Type for Revenue/ Expense Accounts |
Public Function GetFxRuleTypeForRevenueExp(Optional CubeId As Integer, Optional ScenarioId As Integer) As FxRuleType |
Retrieves the default translation Rule Type for Revenue and Expense Accounts in this Cube or Scenario (overrides Cube value). |
Translate |
Public Sub Translate(sourceDataBufferScript As String, destDataBufferScript As String, fxRuleType As FxRuleType, rate As Decimal) |
Performs the translation method assigned to the Cube or Scenario (Periodic or Direct). |
Journals
Name |
Function |
Description |
---|---|---|
Journal Postings Allowed |
Public Function AllowAdjustments(Optional EntityId As Integer, Optional varyByScenarioTypeId As Integer, Optional varyByTimeId As Integer) As Boolean |
Results determine if Journal postings are allowed for the Member. |
Journal Postings from Children Allowed |
Public Function AllowAdjustmentsFromChildren(Optional EntityId As Integer, Optional varyByScenarioTypeId As Integer, Optional varyByTimeId As Integer) As Boolean |
Results determine if Journal postings from children are allowed for this Member. |
Member
Name |
Function |
Description |
---|---|---|
Base Members |
HasChildren = false, e.g. A#Root.Children(HasChildren=False) |
Determines if the Member is a base Member. |
Get Member ID |
api.Members.GetMember(dimTypeId, MemberName).MemberPk.MemberID api.POV.Dimension.Memberpk.Memberid |
Retrieves the name for the selected Member. |
Get Member Name |
api.Members.GetMember(dimTypeId, MemberName).Name |
Retrieves the name for the selected Member. |
Member Lists |
See section of documentation on Creating Member Lists |
Retrieves the Members from a named list stored in a Business Rule. |
Member Name |
api.POV.AccountDim, api.POV.EntityDim, etc |
Retrieves the Member name. |
Member Name or ID |
Get Member name from Member ID: |
Retrieves the Member for the specified ID number or name. |
Top Member |
api.Account.GetTopMemberForDimType(AccountMemberId, dimTypeForTopMember) |
Retrieves the top Member of the selected Dimension. |
Is Base |
Public Function IsBase(dimPk As DimPk, ancestorMemberId As Integer, baseMemberId As Integer, Optional dimDisplayOptions As DimDisplayOptions) As Boolean
myBoolean = api.Members.IsBase(dimPk, ancestorMemberId, baseMemberId, dimDisplayOptions) |
Determines whether the POV Member is the Base of a defined Member. |
Get First Common Parent |
Public Function GetFirstCommonParent(dimPk As DimPk, topMostMemberId As Integer, MemberIdA As Integer, MemberIdB As Integer, Optional dimDisplayOptions As DimDisplayOptions) As Member
myMember = api.Members.GetFirstCommonParent(dimPk, topMostMemberId, MemberIdA, MemberIdB, dimDisplayOptions) |
Returns the first common Parent between multiple Members. |
Scenario
Name |
Function |
Description |
---|---|---|
Scenario Consolidation View |
Public Function GetConsolidationView(Optional ScenarioId As Integer) As ViewMember |
Determines if the Scenario's Consolidation View is set to YTD or Periodic. |
Scenario Default View |
Public Function GetDefaultView(Optional ScenarioId As Integer) As ViewMember |
Retrieves the Scenario's Default View. |
Scenario Input Frequency |
Public Function GetInputFrequency(Optional ScenarioId As Integer) As Frequency |
Retrieves the Scenario's Input Frequency. |
Status
Name |
Function |
Description |
---|---|---|
Calc Status |
Public Function GetCalcStatus(Optional CubeId As Integer, Optional EntityId As Integer, Optional ParentId As Integer, Optional consId As Integer, Optional ScenarioId As Integer, Optional timeId As Integer) As CalcStatus |
Retrieves the calculation status for the data intersection. |
Impact Calc Status |
Public Sub ImpactCalcStatus(Optional CubeId As Integer, Optional EntityId As Integer, Optional ParentId As Integer, Optional consId As Integer, Optional ScenarioId As Integer, Optional timeId As Integer) |
Changes the status of the specified Data Unit to impact. |
Time
Name |
Function |
Description |
---|---|---|
MemberId for the Month to which a Week belongs |
Dim timeIdForMonth As Integer = BRApi.Finance.Time.ConvertIdToClosestIdUsingAnotherFrequency(si, timeIdForWeek, Frequency.Monthly) |
Weekly applications only: This determines to which month a specific week belongs. Used within a Finance Business Rule. |
Functions
Name |
Function |
Description |
---|---|---|
Days Sales Outstanding |
Dim cell As DataCell = api.Functions.GetDSODataCell(acctsReceivableMember, salesMember) |
Calculates Days Sales Outstanding (see below). |
Dynamic Simulation of Consolidation |
api.Functions.GetEntityAggregationDataCell(memberScript as string, Optional useStoredAmountsWhereCalcStatusIsOK as Boolean, Optional fxRateTypeRevenueExpOverride as String, Optional fxRuleTypeRevenueExpOverride as String, Optional fxRateTypeAssetLiabOverride as String, Optional fxRuleTypeAssetLiabOverride as String) |
Pseudo/approximate consolidation of a data cell (see Dynamic Simulation of Consolidation) |
GetStage or GetCustom |
Download the OneStream API Overview Guide from MarketPlace for examples: GetStageBlendTextUsingCurrentPOV GetStageBlendText GetStageBlendNumberUsingCurrentPOV GetStageBlendNumber GetStageBlendDataTableUsingCurrentPOV GetStageBlendDataTable GetCustomBlendDataTableUsingCurrentPOV GetCustomBlendDataTable |
Several functions that retrieve text and calculate values by reading values from the OneStream Stage or a custom relational table. |