Getting Started with Finance Rules
Finance Business Rules are the most common rule type in OneStream. They execute during cube operations — calculations, translations, and consolidations — and give you full control over how data flows through the Finance Engine.
What Are Finance Rules?
Finance Business Rules are written as Shared Business Rules and applied to a Cube, or as Member Formulas on individual dimension members. When a cube operation runs (Calculate, Consolidate, Translate), the Finance Engine fires your rule for each Data Unit — the intersection of Entity, Scenario, Time, Consolidation member, and Parent.
The
api.FunctionType property tells you which operation triggered the rule. Your rule should always check this value and branch accordingly.Finance Function Types
| FinanceFunctionType | Description |
|---|---|
Calculate | Runs additional logic during Entity calculation. The most commonly used function type. |
CustomCalculate | Similar to Calculate but fires on a separate pass, useful for sequential logic. |
Translate | Runs custom currency translation logic. |
FxRate | Determines foreign exchange rates for any intersection. |
ConsolidateShare | Custom logic for calculating the Share (ownership) member. |
ConsolidateElimination | Custom logic for calculating the Elimination member. |
DynamicCalcAccount | Calculates values on-the-fly without storing them. |
MemberList | Provides dynamic member lists at runtime. |
DataCell | Custom logic for individual data cell retrieval. |
CalcDrillDownMemberFormula | Provides custom drill-down results for calculated members. |
ConditionalInput | Controls whether users can input data at a given intersection. |
ConfirmationRule | Validates data before certain operations. |
The Finance Rule Skeleton
Every Finance Business Rule is wrapped in a full VB.NET class with Imports, a Namespace, and a
Main function. Here is the complete boilerplate:Key elements:
si(SessionInfo) — Contains information about the current user session.globals(BRGlobals) — A shared object that persists across Data Unit calculations within a single process. Useful for caching expensive lookups.api(FinanceRulesApi) — The context-specific API for the current calculation. Provides access to data, dimensions, entities, and more.args(FinanceRulesArgs) — Contains arguments about what triggered the rule, includingFunctionType.ErrorHandler.LogWrite— The standard OneStream pattern for catching and re-throwing exceptions with proper logging.
Rule Execution Flow
The following diagram shows how OneStream determines which logic to execute based on the operation type:
Your rule fires once per Data Unit, so always add guard conditions at the top to skip Data Units that don't need your logic. This is the single most impactful performance practice:
Related Content
Continue with the rest of the Finance Rules guide series:
- Understanding Data Units — Learn how OneStream breaks calculations into Data Units and how to write efficient guard conditions
- Writing Calculations — Master stored calculation techniques, Calculate vs. CustomCalculate, and when to use Business Rules vs. Member Formulas
- The Finance Rules API — Explore the Finance Rules API object, BRApi static class, and code sharing patterns