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

Knowledge Base Articles

Net Profit Percent

Efficiency Measure: It reveals the remaining profit after all costs of production, administration, and financing have been deducted from sales, and income taxes recognized. ' Calculate Net Profit Percent ' Formula: Operating Profit/Sales or Operating...

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

Finance: Inventory Turnover

Efficiency Measure: The Inventory turnover is a measure of the number of times inventory is sold or used in a time period such as a year. Formula: COGS/ Average Inventory 'Calculate Inventory Turnover 'Formula: Cost of Goods Sold / Average Inventory ...

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

Finance: Inventory period

Efficiency Measure: Inventory period is a measure of the average number of days inventory is held. Formula: Average Inventory/ (Annual COGS/365) or 365/ Inventory Turnover 'Calculate Inventory Period 'Formula: Average Inventory/ (Annual COGS/365) or ...

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

Finance: Gross Margin

Efficiency Measure: The gross margin represents the percent of total sales revenue that the company retains after incurring the direct costs associated with producing the goods and services sold by a company. Formula: Gross Margin Pct = Gross Profit ...

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

Finance: Average Collection Period

Efficiency Measure: The approximate amount of time it takes for a business to receive payments owed, in terms of receivables, from its customers and clients. Formula: Accounts Receivable/ (Annual Credit Sales/ 365) or 365/ Receivables Turnover 'Calcu...

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

Finance: Asset Turnover

Efficiency Measure: The Asset Turnover ratio is an indicator of the efficiency with which a company is deploying its assets. Formula: Sales / Inventory 'Calculate Asset Turnover 'Formula: Sales / Inventory Return api.Data.GetDataCell("Divide(A#[YourS...

OSAdmin by Valued Contributor
  • 379 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
  • 1375 Views
  • 0 comments
  • 4 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
  • 541 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
  • 403 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
  • 518 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
  • 610 Views
  • 0 comments
  • 1 kudos

How can I bypass importing lines of data?

'Check the parsed value for the criteria string If StringHelper.FindIgnoreCase(args.Value, "[String To Find]") Then ' Set the bypass switch on the globals object ' in order to tell the parser engine to skip this line. globals.Bypass = True End If Ret...

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

Retrieve File Name during Import

'--------------------------------------------------------------------------------------- 'Reference Code: XFR_GetFilenameForSourceID ' 'Description: Gets the file name being processed, strips off the unique indentifier that XF ' adds to the file name...

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