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

Knowledge Base Articles

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
  • 940 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
  • 1419 Views
  • 0 comments
  • 5 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
  • 1389 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
  • 1445 Views
  • 0 comments
  • 0 kudos

VB: Check if Object is valid

It is good practice to test whether an object (typically returned by another function) is empty, before performing some operation on it: 'Substitute thisObject with your object's name If thisObject IsNot Nothing Then '... End If

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

Finance Business Rules: Helper Sub for Eval

The EVAL function in Calculate calls can be used to invoke a custom Sub routine on the contents of a buffer, before or after some calculation. The Sub must accept specific parameters as shown here. Typically, developers will copy this declaration fro...

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

Finance Business Rules: Helper Sub

Example of a helper Sub. Sub allows developers to isolate a chunk of code that will be executed repeatedly in some code, without having to return results. They can be placed in Member Formula in the Helper Functions section, or in Business Rules. 'Su...

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

Finance Business Rule: Helper Function

This is an example of helper function that could be placed either in a Member Formula (in the Helper Functions section) or in a Business Rule (before the End Class line). Functions and subs allow developers to isolate chunks of code that will be repe...

OSAdmin by Valued Contributor
  • 621 Views
  • 0 comments
  • 1 kudos
Top Contributors