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 Community Manager
  • 501 Views
  • 0 comments
  • 4 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
  • 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
  • 1416 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
  • 1381 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
  • 1440 Views
  • 0 comments
  • 0 kudos

Finance Dynamic Calc: Annotations Consolidations

This DynamicCalc formula consolidates Annotations for entities in a hierarchy. 'Cube View definition 'Row Definition: E#[Total GolfStream].tree 'Col1 Definition: V#Annotation:Name("Comment") 'Col2 Definition: V#Annotation:UD8#DynamicTextCons:Name("Co...

OSAdmin by Valued Contributor
  • 1398 Views
  • 0 comments
  • 4 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
  • 537 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
  • 619 Views
  • 0 comments
  • 1 kudos
Labels
Top Contributors