Accepted Code Samples
OneStream approved sample code snippets and examples to help everyone write rules.

Knowledge Base Articles

Filter IC Dimension by Entity Property

A common requirement for reporting is to be able to filter the IC dimension by some property that exists only on the original Entity members. This can be achieved with a custom Member List defined in a Finance business Rule. Select Case api.FunctionT...

JackLacava_0-1704889740618.png
JackLacava by Honored Contributor
  • 647 Views
  • 0 comments
  • 5 kudos

Extender: Rename a dimension

This snippet will rename a dimension. Note: RenameDim does not create entries in Audit tables, which means the Audit Metadata report will not contain anything related to this operation. For this reason, we do not recommend to use this snippet outside...

OSAdmin by Valued Contributor
  • 996 Views
  • 0 comments
  • 0 kudos

Extender: Auto Update Member Property

This snippet will modify a Member property that can vary by Scenario Type and/or Time. Just pass the relevant ScenarioType ID or Time member ID to set it in a more specific way; it will then appear as a "Stored Item" in the interface. Note: SaveMembe...

OSAdmin by Valued Contributor
  • 1607 Views
  • 0 comments
  • 6 kudos

Extender: Auto Create Member

This snippet will create a new Account member, including setting some properties that can vary by Scenario Type and/or Time. Note: SaveMemberInfo does not create entries in Audit tables, which means the Audit Metadata report will not contain anything...

OSAdmin by Valued Contributor
  • 1633 Views
  • 0 comments
  • 3 kudos

Extender: User Inactivity Email

This Extender can be executed in a Data Management step to automate emailing details of an auto-expiring account to the related user. Imports System Imports System.Data Imports System.Data.Common Imports System.IO Imports System.Collections.Generic I...

OSAdmin by Valued Contributor
  • 1688 Views
  • 0 comments
  • 1 kudos

Extender: automate Import, Validate, Load

This example will perform Import, Validate, Load as a batch operation. The approach is typically seen in Extenders or Event Handlers. 'Set Processing Switches Dim valTransform As Boolean = True Dim valIntersect As Boolean = True Dim loadCube As Boole...

OSAdmin by Valued Contributor
  • 1443 Views
  • 0 comments
  • 1 kudos

Extender: Automate Application Metadata Backup

This is an example Extender rule that extracts all application metadata to a zip file, for the current application. The file is created in the application Data Management Export folder, in the File Share directory. 'Prepare the Stage Data Extract Fil...

OSAdmin by Valued Contributor
  • 1048 Views
  • 0 comments
  • 3 kudos

Dashboard: Get or Set Literal Parameter

Literal Parameters are, effectively, application-wide variables that can be used to drive Dashboards and Cube Views. Their values can be set or retrieved in code as shown below. From version 7.3 onwards, they are contained in a Workspace. That means ...

OSAdmin by Valued Contributor
  • 1644 Views
  • 0 comments
  • 0 kudos

Dashboard: Open Dashboard File Resource

Open a Dashboard file resource and retrieve its raw contents. Note: This snippet is for OneStream 7.4 and above. Previous releases can use similar logic, just without the WorkspaceID machinery. ' *** parameters to customize to your needs ' Specify th...

OSAdmin by Valued Contributor
  • 829 Views
  • 0 comments
  • 1 kudos

Dashboard: XFBR String

Business rules written and used as Parameters that return a specific value based on the defined inputs. This Business Rule can be applied to any Dashboard or Cube View property where a Parameter is used. Imports System Imports System.Data Imports Sys...

OSAdmin by Valued Contributor
  • 2616 Views
  • 0 comments
  • 2 kudos

Dashboard: Data Sets

DashboardDataSet Rules are used to create programmatic query results. This rule type enables the rule writer to combine multiple types of data into a single result set using the full syntax capability of VB.Net. '-------------------------------------...

OSAdmin by Valued Contributor
  • 1521 Views
  • 0 comments
  • 1 kudos

Finance: Daily Revenue

An account that calculates Daily Revenue by taking three months of Total Revenue and dividing it down to a daily amount 'Calculate Daily Revenue 'Get Text1 priority from current Scenario to learn which Scenario to copy prior data from Dim priorScenar...

OSAdmin by Valued Contributor
  • 719 Views
  • 0 comments
  • 0 kudos

Finance: Annualized Revenue

This Dynamic Calc formula calculates Annualized Revenue, by taking 3 months of Total Revenue, dividing it down to a monthly amount, then multiplying it by 12. ' "Prior Scenario" must be stored as Text1 property in current Scenario Dim priorScenario A...

OSAdmin by Valued Contributor
  • 762 Views
  • 0 comments
  • 0 kudos

Finance: Return on Capital Employed

This formula calculates a financial ratio that measures a company's profitability and the efficiency with which its capital is employed. The main financial logic in the formula is EBIT / (Total Assets - Total Liabilities) Return api.Data.GetDataCell(...

OSAdmin by Valued Contributor
  • 482 Views
  • 0 comments
  • 1 kudos

Finance: Return on Total Assets

Efficiency Measure: The ratio is considered an indicator of how effectively a company is using its assets to generate earnings before contractual obligations must be paid. Formula: EBIT / Total Net Assets 'Calculate Return on Total Assets 'Formula: E...

OSAdmin by Valued Contributor
  • 572 Views
  • 0 comments
  • 1 kudos

Finance: Return on Equity

Efficiency Measure: Return on equity measures a corporation's profitability by revealing how much profit a company generates with the money shareholders have invested. Formula: ROE= Net Inocme/ Average Shareholders Equity 'Calculate Return on Equity ...

OSAdmin by Valued Contributor
  • 838 Views
  • 0 comments
  • 1 kudos

Finance: Return on Assets

Efficiency Measure: An indicator of how profitable a company is relative to its total assets. It gives an idea as to how efficient management is at using its assets to generate earnings. Formula: ROA = Net Income / Average Total Assets 'Calculate Ret...

OSAdmin by Valued Contributor
  • 581 Views
  • 0 comments
  • 1 kudos

Finance: Receivables Turnover

Efficiency Measure: The receivables turnover ratio is an activity ratio, measuring how efficiently a firm uses its assets. Formula: Net Credit Sales/ Average Accounts Receivable 'Calculate Receivables Turnover 'Formula: Net Credit Sales/ Average Acco...

OSAdmin by Valued Contributor
  • 463 Views
  • 0 comments
  • 0 kudos

Finance: Profit Margin

Efficiency Measure: The percentage of revenue remaining after all operating expenses, interest, taxesand preferred stock dividends (but not common stock dividends) have been deducted from a company's total revenue Formula: Net Profit Margin = Net Inc...

OSAdmin by Valued Contributor
  • 547 Views
  • 0 comments
  • 0 kudos

Finance: Operating Margin

Efficiency Measure: Operating margin is a measurement of what proportion of a company's revenue is left over after paying for variable costs of production such as wages, raw materials, etc. Formula: Operating Margin = Net Income / Net Sales 'Calculat...

OSAdmin by Valued Contributor
  • 527 Views
  • 0 comments
  • 0 kudos
Top Contributors