This chapter explains how to develop and use formulas to calculate a database. It provides detailed examples of formulas, which you may want to adapt for your own use. For more examples, see Examples of Formulas.
This chapter includes the following sections:
Your use of formulas can have significant implications for calculation performance. After reading this section, use the information in Optimizing Calculations to design and create formulas optimized for performance.
For information on using formulas with Hybrid Analysis, see Using Formulas with Hybrid Analysis in Accessing Relational Data with Hybrid Analysis.
Formulas calculate relationships between members in a database outline. You can use formulas in two ways:
The following figure shows the Measures dimension from the Sample Basic database. The Margin %, Profit %, and Profit per Ounce members are calculated using the formulas applied to them.
Figure 370: Calculation of Margin %, Profit %, and Profit per Ounce
Essbase provides a comprehensive set of operators and functions, which you can use to construct formula calculations on a database. The rest of this section provides a description of the elements you can place in a formula, and provides basic information about formula calculation and syntax:
The following table shows the types of operators you can use in formulas:
Operator Type |
Description |
---|---|
Perform common arithmetic operations. For example, you can add, subtract, multiply, or divide values. For a complete list of the mathematical operators, see the Technical Reference in the docs directory. |
|
Control the flow of formula executions based on the results of conditional tests. For example, you can use an IF statement to test for a specified condition. For a list of the conditional operators, see the Technical Reference in the docs directory. For more information on writing conditional formulas, see Specifying Conditions. |
|
Point to the data values of specific member combinations. For example, point to the sales value for a specific product in a specific region. For more information, see Using the Cross-Dimensional Operator ( -> ). |
See Inserting Text and Operators in a Formula for information on how to add operators to formulas.
For information about using operators with #MISSING, zero, and other values, see the Technical Reference in the docs directory in the Essbase Functions section.
Functions are predefined routines that perform specialized calculations and return sets of members or data values. The following table shows the types of functions you can use in formulas:
Function Type |
Description |
---|---|
Provide a conditional test by returning either a TRUE (1) or FALSE (0) value. For example, you can use the @ISMBR function to determine whether the current member is one that you specify. For more information, see Examples of Formulas. |
|
Perform specialized mathematical calculations. For example, you can use the @AVG function to return the average value of a list of members. For more information, see Examples of Formulas. |
|
Look up data values within a database during a calculation. For example, you can use the @ANCESTVAL function to return the ancestor values of a specified member combination. For more information, see Examples of Formulas. |
|
Declare a range of members as an argument to another function or command. For example, you can use the @SUMRANGE function to return the sum of all members that lie within a specified range. For more information, see Examples of Formulas. |
|
Perform specialized financial calculations. For example, you can use the @INTEREST function to calculate simple interest or the @PTD function to calculate period-to-date values. For more information, see Examples of Formulas. |
|
Generate a list of members that is based on a specified member. For example, you can use the @ICHILDREN function to return a specified member and its children. For more information, see the Technical Reference in the docs directory. |
|
Allocate values that are input at a parent level across child members. You can allocate values within the same dimension or across multiple dimensions. For example, you can use the @ALLOCATE function to allocate sales values that are input at a parent level to the parent's children; each child's allocation is determined by its share of the previous year's sales. |
|
Manipulate data for the purposes of smoothing or interpolating data, or calculating future values. For example, you can use the @TREND function to calculate future values that are based on curve-fitting to historical values. |
|
Calculate advanced statistics. For example, you can use the @RANK function to calculate the rank of a specified member or a specified value in a data set. |
|
Use date and time characteristics in calculation formulas. For example, you can use the @TODATE function to convert date strings to numbers that can be used in calculation formulas. |
|
This type provides two different kinds of functionality:
|
|
This type enables you to perform functions that you develop for your calculation operations. These custom-developed functions are written in the Java programming language and are called by the Essbase calculator framework as external functions. |
For a complete list of operators, functions, and syntax, see the Technical Reference in the docs directory.
Note: Abbreviations of functions are not supported. Some commands may work in an abbreviated form, but if there is another function with a similar name, Essbase may use the wrong function. Use the complete function name to ensure correct results.
You can include dimension and member names in a formula, for example:
Scenario 100-10 Feb
You can assign a constant value to a member:
In this formula, California is a member in a sparse dimension and 120 is a constant value. Essbase automatically creates all possible data blocks for California and assigns the value 120 to all data cells. Many thousands of data blocks may be created. To assign constants in a sparse dimension to only those intersections that require a value, use FIX as described in Improving Performance for Constants in a Sparse Dimension.
When you assign a constant to a member in a sparse dimension, you do not need to enable Create Blocks on Equations. However, if you assign anything other than a constant to a member in a sparse dimension, and no data block exists for that member, you still need to enable Create Blocks on Equations.
For example, you need to enable Create Blocks on Equations for this formula:
West = California + 120;
To enable Create Blocks on Equations, use this procedure:
Essbase displays the Database Settings dialog box.
Tip: You can enable Create Blocks on Equations without Application Manager:
Tool |
Instructions |
For More Information |
---|---|---|
For formulas applied to members in a database outline, Essbase calculates formulas when you do the following:
For a formula in a calculation script, Essbase calculates the formula when it occurs in the calculation script.
If a formula is associated with a dynamically calculated member, Essbase calculates the formula when the user requests the data values. In a calculation script, you cannot calculate a dynamically calculated member or make a dynamically calculated member the target of a formula calculation. For more information, see Dynamically Calculating Data Values.
Using dynamically calculated members in a formula on a database outline or in a calculation script can significantly affect calculation performance. Performance is affected because Essbase has to interrupt the regular calculation to perform the dynamic calculation.
You cannot use substitution variables in formulas that you apply to the database outline. For more information, see Using Substitution Variables.
When you create member formulas, make sure the formulas follow these rules:
Margin % Sales;
"Opening Inventory" = "Ending Inventory" - Sales + Additions;
For a complete list of member names that must be enclosed in quotation marks, see Rules for Naming Dimensions and Members.
For example, the following formula contains a simple IF... ENDIF statement. You can apply this formula to the Commission member in a database outline:
IF(Sales < 100) Commission = 0; ENDIF;If you are using an IF statement nested within another IF statement, end each IF with an ENDIF. For example:
"Opening Inventory" (IF (@ISMBR(Budget)) IF (@ISMBR(Jan)) "Opening Inventory" = Jan; ELSE "Opening Inventory" = @PRIOR("Ending Inventory"); ENDIF; ENDIF;)
IF (@ISMBR(@DESCENDANTS(West)) OR @ISMBR(@DESCENDANTS(East) Marketing = Marketing * 1.5; ELSEIF(@ISMBR(@DESCENDANTS(South))) Marketing = Marketing * .9; ELSE Marketing = Marketing * 1.1; ENDIF;Note: If you use ELSE IF (with a space in between) rather than ELSEIF (one word) in a formula, you must supply an ENDIF for the IF statement.
When writing formulas, you can check the syntax using the Formula Editor syntax checker. For more information, see Writing Formulas.
For detailed information on syntax for Essbase functions and commands, see the Technical Reference in the docs directory.
This section provides a step-by-step example of creating and saving a simple formula in an outline using the Formula Editor. For an example of creating a formula in a calculation script, see Developing Calculation Scripts. For detailed information on creating formulas, and obtaining the required calculation results, consider all the information in Calculating Data.
This example is based on the Sample Basic database, which is supplied with the Essbase installation. If you do not have Sample Basic installed, contact your Essbase administrator.
This example shows you how to create a formula on the Variance member of the Scenario dimension. This formula calculates the variance between Budget values and Actual values.
To create the example formula:
Figure 371: Application Desktop Window
If another user has Sample Basic open and locked, you can clear "Lock file" in the bottom right-hand corner of the application desktop window. However, if you clear "Lock file," you cannot save your work.
Figure 372: Scenario Dimension in Sample Basic Outline
Essbase displays the formula in Formula Editor.
Figure 373: Formula Editor Showing Variance Formula
Figure 374: Formula Editor With Variance Formula Deleted
Essbase displays Scenario in the Members list.
Figure 375: Formula Editor Dimensions and Members Lists With Scenario Selected
Essbase displays the Function Templates dialog box.
Essbase displays the function and the default arguments below the Categories list.
Figure 376: Function Templates Dialog Box
Essbase inserts @VAR (mbrName1, mbrName2) at the cursor position.
Figure 377: Formula Editor With Variance Formula Added
You have recreated the formula on Variance in Sample Basic.
You use Formula Editor in Application Manager to create formulas. You can type the formulas directly into the formula text area, or you can use the Formula Editor user interface features to create the formula.
Formulas are ASCII text. If required, you can create a formula in the text editor of your choice and paste it into Formula Editor.
This section explains how to perform basic formula creation tasks using the Formula Editor:
Note: You can also check syntax in some situations with the Formula Editor. For instructions, see Checking Syntax on the Client.
Open Formula Editor to create new formulas or open existing ones.
To open Formula Editor from Application Manager:
Essbase opens Formula Editor for the selected member. If the member already has a formula, the formula is displayed in Formula Editor. The following figure shows Formula Editor for the Variance member in the Sample Basic database.
Open the database outline to display members and their associated formulas in Outline Editor. You can also highlight the member for which you want to see a formula and click the
button to open Formula Editor.
You can also use the GETMBRCALC command in ESSCMD to display member formulas. See the Technical Reference in the docs directory for information about this command. See Automating the Production Environment for information about ESSCMD.
You can use Application Manager to add a formula to a database outline.
To change an existing formula, open it in Formula Editor.
You can save formulas to the database outline.
To save a formula after you have created or opened it:
Essbase displays the formula beside the member in the database outline.
You can print the contents of a formula from Formula Editor.
To print a formula, in Formula Editor, select File > Print, or click the
button.
You can delete a formula that has been saved to the database outline.
Essbase displays the formula in the Formula Editor window.
Essbase no longer displays the formula beside the member in the database outline.
To undo the last action, in Formula Editor, select Edit > Undo, or click the
button.
You can type text and operators directly into the Formula Editor text area, or you can use the toolbar buttons to add the text and operators. You can also copy, cut, and search for text in Formula Editor.
To type text in Formula Editor:
Text is displayed at the cursor position as you type.
To insert an equal sign (=) in a formula:
To insert a mathematical operator (+, -, X, /, %) in a formula:
To insert the cross-dimensional operator ( -> ) in a formula:
For more information on the cross-dimensional operator, see Using the Cross-Dimensional Operator ( -> ).
To insert the semicolon formula end-of-line character (;) in a formula:
To insert a function or operator in a formula:
Essbase displays the Function Templates dialog box.
Essbase displays the function or operator and the default arguments below the Categories list.
Figure 380: Function Templates Dialog Box With Math Category Selected
Essbase inserts @VAR ( ) at the cursor position.
Figure 381: Formula Editor Showing @VAR Formula
If you checked Insert Arguments, Essbase inserts @VAR and default, temporary arguments. You can then type over the default arguments with the correct arguments.
To cut text in Formula Editor:
Select the text that you want to cut and do one of the following:
To copy text in Formula Editor:
Select the text that you want to copy and do one of the following:
To paste text in Formula Editor:
Select the text that you want to paste and do one of the following:
To find and replace text in Formula Editor:
Figure 383: Formula Editor Find Dialog Box
To do a case-sensitive search in Formula Editor:
For example, to search for Margin but not "margin," type Margin in the Find what text box, and select Match case.
You can insert dimension and member names in Formula Editor instead of typing them.
To insert a dimension name in a formula:
The dimension name displays in the Members list. If a
button displays to the left of the dimension name, then the dimension has children. The following shows the Scenario dimension in the Sample Basic database.
Figure 384: Formula Editor Dimensions and Members Lists
Essbase inserts the dimension name at the cursor position. To insert a member name (a member name other than the dimension name), expand the member branch and select the member you want to insert.
To expand a member branch to display a member's children:
In the Members list, double-click the
button next to the member name to display the member's children.
The
button changes to a
button.
Figure 385: Formula Editor Dimensions and Members Lists, Expanding the Scenario Member
Double-click the
button to collapse the member branch.
In the Members list, double-click the
button to collapse the member branch.
Figure 386: Formula Editor Dimensions and Members Lists, Expanded Scenario Dimension
The
button changes to a
button. Essbase does not display the member's children:
Figure 387: Formula Editor Dimensions and Members Lists, Collapsing the Scenario Dimension
To search for a specific member in Formula Editor:
For example, select the Measures dimension from the Sample Basic database.
Essbase displays the Find dialog box.
Figure 388: Formula Editor Find Dialog Box
For example, to search for the Marketing member in the Measures dimension, type market.
For example, to search for Margin, but not Margin %, type margin in the Find what text box, and select Match whole word only.
For example to search for Margin, but not margin, type Margin in the Find what text box, and select Match case.
Essbase finds and selects the Marketing member.
Figure 389: Formula Editor Members List With Marketing Selected
To expand a dimension to display all members in Formula Editor:
For example, select the Product dimension in the Sample Basic database.
Figure 390: Formula Editor Dimensions and Members List
With Product Selected
In the Members list, Essbase displays all members in the dimension.
Figure 391: Formula Editor Dimensions and Members List
Showing the Children of Product
To display and insert alias names in Formula Editor, check Use Aliases.
Essbase displays the alias names for the members. The following example shows the Product dimension from the Sample Basic database.
Figure 392: Formula Editor Dimensions and Members List with Alias Names
To select a different alias table, from the Alias Table list box, select a table.
When you select a member from the Members list, Essbase inserts the alias name at the cursor position. If required, Essbase automatically encloses the alias name in double quotation marks (" ").
The following sections discuss and give examples of the main types of formulas:
For more examples of formulas, see Examples of Formulas.
Before writing formulas, review the guidelines in Understanding Formula Syntax.
You can apply a mathematical operation to a formula to create a basic equation. For example, you can apply the following formula to the Margin member in Sample Basic.
Sales - COGS;
In a calculation script, you define basic equations as follows:
Member = mathematical operation;
where Member is a member name from the database outline and mathematical operation is any valid mathematical operation. For example:
Margin = Sales - COGS;
Whether the example equation is in the database outline or in a calculation script, Essbase cycles through the database subtracting the values in COGS from the values in Sales and placing the results in Margin.
As another example, you can apply the following formula to a Markup member:
(Retail - Cost) % Retail;
In a calculation script, this would be:
Markup = (Retail - Cost) % Retail;
In this example, Essbase cycles through the database subtracting the values in Cost from the values in Retail, calculating the resulting values as a percentage of the values in Retail, and placing the result in Markup.
For more information on the nature of multidimensional calculations, see Introduction to Database Calculations.
You can define formulas that use a conditional test or a series of conditional tests to control the flow of calculation.
The IF and ENDIF commands define a conditional block. The formulas between the IF and the ENDIF commands are executed only if the test returns TRUE (1). You can use the ELSE and ELSEIF commands to specify alternative actions if the test returns FALSE (0). The formulas following each ELSE command are executed only if the previous test returns FALSE (0). Conditions following each ELSEIF command are tested only if the previous IF command returns FALSE (0).
For more information on the syntax of the IF and ENDIF commands, see Understanding Formula Syntax.
When you use a conditional formula in a calculation script, you must enclose it in parentheses and associate it with a member in the database outline, as shown in the examples in this section.
In conjunction with an IF command, you can use functions that return TRUE or FALSE (1 or 0, respectively) based on the result of a conditional test. These functions are known as Boolean functions.
You use Boolean functions to determine which formula to use. The decision is based on the characteristics of the current member combination. For example, you might want to restrict a certain calculation to the members in the Product dimension that contain input data. In this case, you preface the calculation with an IF test based on @ISLEV(Product,0).
If one of the function parameters is a cross-dimensional member, such as @ISMBR(Sales -> Budget), all of the parts of the cross-dimensional member must match the properties of the current cell to return a value of TRUE (1).
You can use the following Boolean functions to specify conditions.
When you place formulas on the database outline, you can use only the IF, ELSE, ELSEIF, and ENDIF commands and Boolean functions to control the flow of the calculations. You can use additional control commands in a calculation script.
For more information on calculation scripts, see Developing Calculation Scripts. For more information on Essbase functions and calculation commands, see the Technical Reference in the docs directory.
You can apply the following formula to a Commission member in the database outline. In the first example, the formula calculates commission at 1% of sales if the sales are greater than 500000:
IF(Sales > 500000) Commission = Sales * .01; ENDIF;
If you place the formula in a calculation script, you need to associate the formula with the Commission member as follows:
Commission(IF(Sales > 500000) Commission = Sales * .01; ENDIF;)
Essbase cycles through the database, performing these calculations:
In the next example, the formula tests the ancestry of the current member and then applies the appropriate Payroll calculation formula.
IF(@ISIDESC(East) OR @ISIDESC(West)) Payroll = Sales * .15; ELSEIF(@ISIDESC(Central)) Payroll = Sales * .11; ELSE Payroll = Sales * .10; ENDIF;
If you place the formula in a calculation script, you need to associate the formula with the Payroll member as follows:
Payroll(IF(@ISIDESC(East) OR @ISIDESC(West)) Payroll = Sales * .15; ELSEIF(@ISIDESC(Central)) Payroll = Sales * .11; ELSE Payroll = Sales * .10; ENDIF;)
Essbase cycles through the database, performing the following calculations:
For more information on the nature of multidimensional calculations, see Introduction to Database Calculations. For more information on the @ISIDESC function, see the Technical Reference in the docs directory.
Use this section to find information about formulas related to values:
Essbase optimizes calculation performance by calculating formulas for a range of members in the same dimension at the same time. However, some formulas require values from members of the same dimension, and Essbase may not yet have calculated the required values.
A good example is that of cash flow, in which the opening inventory is dependent on the ending inventory from the previous month.
In Sample Basic, the Opening Inventory and Ending Inventory values need to be calculated on a month-by-month basis.
Jan |
Feb |
Mar |
|
---|---|---|---|
Opening Inventory |
|||
Sales |
|||
Addition |
|||
Ending Inventory |
Assuming that the Opening Inventory value for January is loaded into the database, the required calculation is:
1. January Ending = January Opening - Sales + Additions 2. February Opening = January Ending 3. February Ending = February Opening - Sales + Additions 4. March Opening = February Ending 5. March Ending = March Opening - Sales + Additions
You can calculate the required results by applying interdependent, multiple equations to a single member in the database outline.
The following formula, applied to the Opening Inventory member in the database outline, calculates the correct values:
IF(NOT @ISMBR (Jan)) "Opening Inventory" = @PRIOR("Ending Inventory"); ENDIF; "Ending Inventory" = "Opening Inventory" - Sales + Additions;
If you place the formula in a calculation script, you need to associate the formula with the Opening Inventory member as follows:
"Opening Inventory" (IF(NOT @ISMBR (Jan))
"Opening Inventory" = @PRIOR("Ending Inventory");
ENDIF;
"Ending Inventory" = "Opening Inventory" - Sales + Additions;)
Essbase cycles through the months, performing the following calculations:
Note: To calculate the correct results, it is necessary to place the above formula on a single member, Opening Inventory. If you place the formulas for Opening Inventory and Ending Inventory on their separate members, Essbase calculates Opening Inventory for all months and then Ending Inventory for all months. This means that the value of the previous month's Ending Inventory is not available when Opening Inventory is calculated.
You can use the @VAR and @VARPER functions to calculate a variance or percentage variance between budget and actual values.
You may want the variance to be positive or negative, depending on whether you are calculating variance for members on the accounts dimension that are:
You want Essbase to show a positive variance if the actual values are lower than the budget values. For example, you want Essbase to show a positive variance if actual costs are lower than budgeted costs.
You want Essbase to show a negative variance if the actual values are lower than the budget values. For example, you want Essbase to show a negative variance if actual sales are lower than budgeted sales.
By default, Essbase assumes that members are non-expense items and calculates the variance accordingly.
To tell Essbase that a member is an expense item, use this procedure:
Essbase tags the member as an expense item. When you use the @VAR or @VARPER functions, Essbase shows a positive variance if the actual values are lower than the budget values.
For example, in Sample Basic, the children of Total Expenses are expense items. The Variance and Variance % members of the Scenario dimension calculate the variance between the Actual and Budget values.
You can allocate values that are input at the parent level across child members in the same dimension or in different dimensions by using the following allocation functions.
Note: For examples of calculation scripts using the @ALLOCATE and @MDALLOCATE functions, see Allocating Values Within or Across Dimensions and the Technical Reference in the docs directory.
You can manipulate data for the purposes of smoothing data, interpolating data, or calculating future values by using the following forecasting functions.
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can use the member combination that Essbase is currently calculating to look up specific values. These functions are referred to as relationship functions.
For more information on Essbase functions, see the Technical Reference in the docs directory.
Substitution variables act as placeholders for information that changes regularly; for example, time period information. You can use substitution variables in formulas that you include in a calculation script. You cannot use substitution variables in formulas that you apply to the database outline.
When you run a calculation script, Essbase replaces the substitution variable with the value you have assigned to it. You can create and assign values to substitution variables using Application Manager or ESSCMD.
You can set substitution variables at the server, application, and database levels. Essbase must be able to access the substitution variable from the application and database on which you are running the calculation script.
For more information on creating and assigning values to substitution variables, see Creating Applications and Databases.
To use a substitution variable in a calculation script:
Type an ampersand (&) followed by the substitution variable name.
Essbase treats any text string preceded by & as a substitution variable.
For example, assume that the substitution variable UpToCurr is defined as Jan:Jun. You can use the following @ISMBR function as part of a conditional test in a calculation script:
@ISMBR(&UpToCurr)
Before Essbase runs the calculation script, it replaces the substitution variable, as follows:
@ISMBR(Jan:Jun)
This section provides information you need to create formulas that refer to members:
In some functions you may need to specify more than one member, or you may need to specify a range of members. For example, the @ISMBR function tests to see if a member that is currently being calculated matches any of a list or range of specified members. You can specify members using the following syntax:
If you do not specify a list of members or a range of members in a function that requires either, Essbase uses the level 0 members of the dimension tagged as time. If no dimension is tagged as time, Essbase displays an error message.
You can generate member lists that are based on a specified member by using the these member set functions.
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can work with member names as character strings by using the following functions:
The cross-dimensional operator points to data values of specific member combinations.
You create the cross-dimensional operator using a hyphen (-) and a greater than symbol (>). Do not leave spaces in between the cross-dimensional operator and the member names.
For example, in this simplified illustration, the shaded data value is Sales -> Jan -> Actual.
Figure 394: Defining a Single Data Value by Using the
Cross-Dimensional Operator
The following example illustrates how to use the cross-dimensional operator. This example allocates miscellaneous expenses to each product in each market.
The value of Misc_Expenses for all products in all markets is known. The formula allocates a percentage of the total Misc_Expenses value to each Product -> Market combination. The allocation is based on the value of Sales for each product in each market.
Misc_Expenses = Misc_Expenses -> Market -> Product * (Sales / ( Sales -> Market -> Product));
Essbase cycles through the database, performing these calculations:
Consider carefully how you use the cross-dimensional operator, as it can have significant performance implications. For detailed information, see Optimizing Calculations.
In Equations in a Dense Dimension
When you use a cross-dimensional operator in an equation in a dense dimension, if the resultant values are from a dense dimension and the operand or operands are from a sparse dimension, Essbase does not automatically create the required blocks.
Consider an example from Sample Basic, in which you want to create budget sales and expense data from existing actual data. Sales and Expenses are members in the dense Measures dimension. Budget and Actual are members in the sparse Scenario dimension.
FIX(Budget) (Sales = Sales -> Actual * 1.1; Expenses = Expenses -> Actual * .95;) ENDFIX
Note that results of the equation, Sales and Expenses, are dense dimension members, and the operand, Actual, is in a sparse dimension. The calculation script above does not create the required data blocks, therefore Budget data values cannot be calculated for blocks that do not already exist.
You can solve this problem using either of these techniques:
Using DATACOPY for Equations in a Dense Dimension
You can solve the problem in In Equations in a Dense Dimension by preceding the above formulas with a DATACOPY command:
DATACOPY Sales -> Actual TO Sales -> Budget; DATACOPY Expenses -> Actual TO Expenses -> Budget; FIX(Budget) (Sales = Sales -> Actual * 1.1; Expenses = Expenses -> Actual * .95;) ENDFIX
With DATACOPY, Essbase copies the data and creates the required blocks, in this example, blocks that contain the Budget values for each corresponding Actual block that already exists.
Avoiding Equations in a Dense Dimension
You can solve the problem in In Equations in a Dense Dimension and also avoid copying the data as described in Using DATACOPY for Equations in a Dense Dimension by ensuring that the results members are from a sparse dimension, not from a dense dimension. In this example, Budget is the results member, and it is from a sparse dimension:
FIX(Sales) Budget = Actual * 1.1; ENDFIX FIX(Expenses) Budget = Actual * .95; ENDFIX
You can also use a member formula that contains the dense member equations:
FIX(Sales, Expenses) Budget (Sales = Sales -> Actual * 1.1; Expenses = Expenses -> Actual * .95;) ENDFIX
Use this section to find information about formulas that use other types of formulas:
You can perform many mathematical operations in formulas by using the following mathematical functions.
Operation |
Function |
---|---|
To return the average value of the values in the specified member list |
|
To return the value of e (the base of natural logarithms) raised to power of the specified expression |
|
To return the next lowest integer value of a member or expression |
|
To return the logarithm to a specified base of a specified expression |
|
To return the maximum value among the expressions in the specified member list |
|
To return the maximum value among the expressions in the specified member list, with the ability to skip zero and #MISSING values |
|
To return the minimum value among the expressions in the specified member list |
|
To return the minimum value among the expressions in the specified member list, with the ability to skip zero and #MISSING values |
|
To return the modulus produced by the division of two specified members |
|
To return the value of the specified member raised to the specified power |
|
To return the member or expression rounded to the specified number of decimal places |
|
To return the variance (difference) between two specified members. See Calculating a Variance or Percentage Variance Between Actual and Budget Values. |
|
To return the percentage variance (difference) between two specified members. See Calculating a Variance or Percentage Variance Between Actual and Budget Values. |
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can use these statistical functions to calculate advanced statistics in Essbase.
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can execute a function for a range of members by using these range functions.
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can include financial calculations in formulas by using these financial functions.
For more information on Essbase functions, see the Technical Reference in the docs directory.
You can use dates with other functions by using this date function.
Date Conversion |
Function To Use |
---|---|
Convert date strings to numbers that can be used in calculation formulas |
You can specify which calculation mode that Essbase uses to calculate a formula by using @CALCMODE.
Specification |
Function To Use |
---|---|
To specify that Essbase uses cell, block, bottom-up, and top-down calculation modes to calculate a formula. |
Note: You can also use the configuration setting CALCMODE to set calculation modes to BLOCK or BOTTOMUP at the database, application, or server level. For details, see the Technical Reference in the docs directory, under "essbase.cfg Settings" for CALCMODE or "Essbase Functions" for @CALCMODE.
Custom-defined functions are calculation functions that you create to perform calculations not otherwise supported by the Essbase calculation scripting language. You can use custom-defined functions in formulas and calculation scripts. These custom-developed functions are written in the Java programming language and registered on the server. The Essbase calculator framework calls them as external functions.
If you are connected to the server, the Custom-Defined Functions category appears in the Function Templates dialog box where you can choose function names to be inserted into the formula.
For more information about Custom-Defined Functions, see Developing Custom-Defined Calculation Functions.
Essbase includes both client-based and server-based formula syntax checking that tells you about syntax errors in formulas. For example, Essbase tells you if you have mistyped a function name. If you are connected to a server, unknown names can be validated against a list of custom-defined macro and function names. If you are not connected to a server or the application associated with the outline, Essbase may connect you to validate unknown names.
A syntax checker cannot tell you about semantic errors in a formula. Semantic errors occur when a formula does not work as you expect. To find semantic errors, run the calculation and check the results to ensure that they are as you expect.
Because server-based formula validation has access to more information about the database and outline, this form of validation can take more time to complete. For quicker syntax checking, you can use client-based formula validation to find syntax-related errors. To avoid saving outlines that contain formulas with errors, perform a server-based formula validation and correct all errors before the outline goes into production.
Use the client-based syntax checker to validate formulas and calculation scripts. You can use this feature whether or not you are connected to the server. The client-based syntax checker identifies each error within a formula.
To use the client-based syntax checker to validate a formula in Formula Editor:
Select Syntax > Check Syntax, or click the
button.
Essbase displays the syntax checker results at the bottom of the Formula Editor window. If Essbase finds no syntax errors, it displays the message shown in Figure 395.
Figure 395: Formula Editor Syntax Checker, No Errors Message
If Essbase finds one or more syntax errors, it displays the number of the line that includes the error and a brief description of the error. For example, if you do not include a semicolon end-of-line character at the end of a formula, Essbase displays a message similar to the message shown in Figure 396.
Figure 396: Formula Editor Syntax Checker, Syntax Error Message
To step through errors in Formula Editor:
Select Syntax > Next Error or Syntax > Previous Error.
When you reach the first or last error, Essbase displays the message shown in Figure 397.
Figure 397: Formula Editor Syntax Checker, No More Errors Message
Essbase retains the list of error messages in Formula Editor until you check the syntax again.
You can check the syntax on the server in two ways:
Essbase displays outline errors and warnings in the Verify Outline dialog box, similar to Figure 398.
Figure 398: Example Verify Outline Dialog Box Containing Formula Errors
Select a member name to see associated errors and warnings. For more information about the error or warning, if the error or warning is in the formula attached to the member, click Find to go to that member in the outline. Open Formula Editor, and use the server-based syntax checker to validate the formula.
If Essbase finds no syntax errors, it displays the No Errors message at the bottom of the Formula Editor window, as shown in Figure 399.
Figure 399: Formula Editor Syntax Checker, No Errors Message
If a formula passes validation in Formula Editor or Outline Editor, but the server detects semantic errors when the outline is saved:
After you have corrected the formula and saved the outline, the message in the member comment is deleted. You can view the updated comment when you reopen the outline.
You can estimate the disk size that would be required for a single CALC ALL given either a full data load or a partial data load. For details, see the Technical Reference in the docs directory of your Essbase installation, in the ESSCMD section's entry for ESTIMATEFULLDBSIZE and Estimating Calculations.
An Essbase partition can span multiple servers, processors, or computers. For more information on partitioning, see Designing Partitioned Applications, and Building and Maintaining Partitions.
You can use formulas in partitioning, just as you use formulas on your local database. However, if a formula you use in one database references a value from another database, Essbase has to retrieve the data from the other database when calculating the formula. In this case, you need to ensure that the referenced values are up-to-date and to consider carefully the performance impact on the overall database calculation. For more information, see the information on writing calculation scripts for partitions in Writing Calculation Scripts for Partitions.
With transparent partitions, you need to consider carefully how you use formulas on the data target. For more information, see Transparent Partitions and Member Formulas and Performance Considerations for Transparent Partitions.
![]() © 2002 Hyperion Solutions Corporation. All rights reserved. http://www.hyperion.com |