Essbase Calculation Function
Essbase Calculation Function
Returns the absolute value of expression. The absolute value of a number is that number less its
sign. A negative number becomes positive, while a positive number remains positive.
Syntax
@ABS (expression)
Parameter Description
Variance=@ABS(Actual-Budget);
@ACCUM
Accumulates the values of mbrName within rangeList, up to the current member in the dimension of
which rangeList is a part.
Syntax
Financial functions never return a value; rather, they calculate a series of values internally based on
the range specified.
@ACCUM accepts the @ATTRIBUTE member set function as a member range.
If you use an Essbase member set function to generate a member list for the rangeList parameter (for
example, @SIBLINGS), to ensure correct results, consider the order in which Essbase sorts the
generated member list. For more information, see the Oracle Essbase Technical Reference topic for
the member set function you are using.
You cannot apply an operator (for example divide or multiply) to @Accum. For example, the formula
Budget=@ACCUM(Actual, Jan:Feb)/2 is not valid.
Example
@ALIAS
Takes a string as an argument and returns an alias name to the function that calls @ALIAS.
Syntax
@ALIAS (function_name)
Notes
Because functions that take strings as arguments may not function correctly if the string matches a
member alias, use the function @ALIAS to pass member alias names as strings, for example when
passing alias names as strings to functions such as @ISUDA, @UDA, @CONCATENATE,
@SUBSTRING, @MATCH, or @NAME.
Example
For example, if the value "US$" is both an alias and a user-defined attribute, pass the string using
@ALIAS:
IF(@ISUDA(@ALIAS("US$")))
...
ENDIF
@ALLOCATE
Allocates values from a member, from a cross-dimensional member, or from a value across a
member list. The allocation is based on a variety of criteria.
This function allocates values that are input at an upper level to lower-level members. The allocation
is based upon a specified share or spread of another variable. For example, you can allocate values
loaded to a parent member to all of that member's children. You can specify a rounding parameter
for allocated values and account for rounding errors.
Syntax
@ANCESTORS
Returns all ancestors of the specified member (mbrName) or those up to a specified generation or
level. You can use this member set function as a parameter of another function, where that
parameter is a list of members.
Syntax
#. The generated list of members is sorted starting with the nearest ancestor of the member,
followed by the next nearest ancestor of the member, and so on. Using Sample Basic as an
example, if you specify @ANCESTORS(200-30), Essbase returns 200, Product (in that order). This
order is important to consider when you use the @ANCESTORS member set function with certain
forecasting and statistical functions.
Example
@ANCESTORS("New York")
Syntax
@ATTRIBUTE (attMbrName)
Parameter Description
attMbrName Single attribute member name.
When @ATTRIBUTE is used with a non-level 0 member of an attribute dimension, Essbase returns
all base members that are associated with the children of the attribute member. For example, in the
Sample Basic database, @ATTRIBUTE(Large) returns all base members that fall into one of the
population ranges for the attribute parent Large.
If you specify the name of a Boolean attribute dimension (for example, Caffeinated), Essbase returns
all base members that are associated with either Caffeinated member (for example, True or False).
To return only one, specify the member name (for example, @ATTRIBUTE(Caffeinated_True)).
You may have duplicate Boolean, date, and numeric attribute member names in your outline. For
example, 12 can be the attribute value for the size (in ounces) of a product as well as the value for
the number of packing units for a product. To distinguish duplicate member names, specify the full
attribute member name (for example, @ATTRIBUTE(Ounces_12)).
Example
@ATTRIBUTE(Can);
returns all base members with the Can attribute: Cola, Diet Cola, and Diet Cream.
@AVGRANGE
Returns the average value of the specified member (mbrName) across the specified range
(XrangeList).
Syntax
@BETWEEN
Returns a member set of all members whose name string value fall between, and are inclusive of,
the two specified string tokens. Member names are evaluated alphanumerically.
Syntax
@CALCMODE
Enables the choice of an execution mode of a formula. @CALCMODE can control two types of
modes:
Whether a formula is calculated in block calculation or cell calculation mode when calculating
formulas that contain certain functions (in particular the @ISMBR function)
Using block calculation mode, Essbase groups the cells within a block and simultaneously calculates
the cells in each group. Block calculation mode is fast, but you must carefully consider data
dependencies within the block to ensure that the resulting data is accurate.
Using cell calculation mode, Essbase calculates each cell sequentially, following the calculation
order, which is based on the order of the dense dimensions in the outline.
Essbase uses one of two methods to do a full calculation of an outline: bottom-up calculation (the
default) or top-down calculation. If the outline contains a complex member formula, Essbase
performs a top-down calculation for that member. When a formula is compiled, if the formula is to be
calculated top-down, Essbase logs a message in the application log file.
For a bottom-up calculation, Essbase determines which existing data blocks need to be calculated
before it calculates the database. Essbase then calculates only the blocks that need to be calculated
during the full database calculation. The calculation begins with the lowest existing block number
and works up through each subsequent block until the last existing block is reached.
In contrast, a top-down calculation calculates the formula on all potential datablocks with the
member. A top-down calculation may be less efficient than a bottom-up calculation because more
blocks may be calculated than is necessary. Although a top-down calculation is less efficient than a
bottom-up calculation, in some cases top-down calculations are necessary to ensure that calculation
results are correct.
Syntax
@CALCMODE (CELL|BLOCK|TOPDOWN|BOTTOMUP)
Knowing When Essbase uses Cell or Block Mode and Top-down or Bottom-up Mode
When Essbase compiles a formula, it prints a message in the application log file explaining the mode
of execution for the formula similar to the following message:
When Essbase determines that the formula will be executed in block and bottom-up mode, no message
is written in the application log file.
In calculation scripts, @CALCMODE statements must be placed within parentheses and associated
with a specific database member.
By default, for a simple formula such as A = B + C, Essbase does a bottom-up calculation. A is
calculated only if B or C exists in the database. The dependency of the formula on B and C is known
before the calculation is started.
For a complex formula such as A = B->D + C->D, Essbase performs a top-down calculation because
every possible combination of A must be examined to see whether B->D or C->D exists.
Data dependency occurs if the accurate calculation of one or more members depends on another
member or other on members being calculated previously. Most data dependency issues with block
calculation mode occur when a formula contains IF ELSE or IF ELSEIF conditions. However, data
dependencies can occur in other formulas; for example, when using the @PRIOR function.
When Essbase uses block calculation mode to calculate a formula that contains IF ELSE or IF
ELSEIF conditions, it separates the members being calculated into two groups. The first group
contains the members that satisfy the IF condition. The second group contains the members that
satisfy the ELSE or ELSEIF conditions.
Essbase simultaneously calculates the members in the first group before simultaneously calculating
the members in the second group.
If a formula contains data dependencies, ensure that the following conditions are met:
Members on which the accurate calculation of other members depends are in the first group.
Dependent members are in the second group.
If an IF condition has multiple ELSEIF conditions, Essbase evaluates each ELSEIF condition,
placing the members that satisfy the ELSEIF condition in the first group and the members that
satisfy subsequent ELSEIF or ELSE conditions in the second group.
@CONCATENATE
Returns one character string that is the result of appending one character string (String2) to the end
of another character string (String1).
The @CONCATENATE function can be nested to concatenate more than two strings
Syntax
Notes
To use a member name as a character string, use @NAME with the member name.
To use the resulting character string as a member name, use @MEMBER with the
@CONCATENATE statement; for example,
@MEMBER(@CONCATENATE("2000_", QTR1));
@COUNT
Returns the number of data values in the specified data set (XrangeList).
Syntax
Example
The following example is based on the Sample Basic database. Assume that the Measures
dimension contains an additional member, Prod Count. This example calculates the count of all
products for which a data value exists and uses the @RANGE function to generate expList:
FIX(Product)
@EXPAND
Expands a member search by calling a member set function for each member in a member list. The
members returned by the @EXPAND function are added to the existing member set. Duplicate
members are not removed from the member set.
Syntax
@FACTORIAL
Returns the factorial of expression. The factorial of a number is equal to 1*2*3*...* number.
Syntax
@FACTORIAL (expression)
Parameter Description
expression Single member specification or numeric expression.
Notes
Expression can be no larger than 189. If expression is larger than 189, Essbase returns #MISSING.
If expression is negative, Essbase returns #MISSING.
Example
@FACTORIAL(1) 1
@FACTORIAL(5) 120
@ISACCTYPE
Returns TRUE if the current member has the associated accounts tag.
Syntax
@ISACCTYPE (tag)
@ISANCEST
Returns TRUE if the current member is an ancestor of the specified member. This function excludes
the specified member.
Syntax
@ISANCEST (mbrName)
Example
@ISANCEST(West)
@ISCHILD
Returns TRUE if the current member is a child of the specified member. This function excludes the
specified member.
Syntax
@ISCHILD (mbrName)
Example
@ISCHILD(East)
@ISCHILD(Margin)
@ISDESC
Returns TRUE if the current member is a descendant of the specified member. This function
excludes the specified member.
Syntax
@ISDESC (mbrName)
In the Sample Basic database:
@ISDESC(Market)
@ISDESC(Profit)
@ISGEN
Returns TRUE if the current member of the specified dimension is in the specified generation.
Syntax
@ISIANCEST
Returns TRUE if the current member is the specified member or an ancestor of the specified
member. This function includes the specified member.
Syntax
@ISIANCEST (mbrName)
Example
@ISIANCEST(California)
Returns TRUE for Market, West, and California. California is the specified member, and West and
Market are ancestors of California.
@ISIANCEST(Qtr1)
Returns FALSE for Jan, Feb, Mar, Qtr2. None of these members is the specified member (Qtr1) or
an ancestor of Qtr1.
@ISIBLINGS
Returns the specified member and all siblings of that member. This member set function can be
used as a parameter of another function, where that parameter is a list of members.
Syntax
@ISIBLINGS (mbrName)
@ISIPARENT
Returns TRUE if the current member is the specified member or the parent of the specified member.
Syntax
@ISIPARENT (mbrName)
Example
@ISIPARENT(Qtr1)
@ISIPARENT(Margin)
@ISISIBLING
Returns TRUE if the current member is the specified member or a sibling of the specified member.
Syntax
@ISISIBLING (mbrName)
Example
@ISISIBLING(Qtr2)
@ISISIBLING(Actual)
@ISLEV
Returns TRUE if the current member of the specified dimension is in the specified level.
Syntax
Example
@ISLEV(Market,0)
Returns TRUE if the current member of Market is New York, California, Texas, or Illinois.
@ISLEV(Year,1)
@ISMBR
Returns TRUE if the current member matches any one of the specified members.
Syntax
If a cross-dimensional (->) member is included, that term evaluates as TRUE only if all the
components of the cross-dimensional member match the current member list.
Example
@ISMBR(@CHILDREN(Qtr1))
@ISMBRUDA
Returns TRUE if the specified user-defined attribute (UDA) exists for the specified member at
calculation time.
Syntax
@ ISMBRUDA(mbrName, UDAStr)
Parameter Description
mbrName Valid member name or member combination, or a function that returns a member or member combination.
If a nonexistent member name is specified, calculation script verification fails with an error code.
Example
The following examples use the Sample.Basic database.
Because “New York” is not a small market, the first condition returns false.
IF(@ISMBRUDA("New York")
@ISMBRWITHATTR
Returns TRUE if the current member belongs to the list of base members that are associated with an
attribute that satisfies the conditions you specify.
Syntax
Notes
This function is a superset of the @ISATTRIBUTE function. The following two formulas return the
same member set:
@ISATTRIBUTE(Bottle)
@ISMBRWITHATTR("Pkg Type","==",Bottle)
However, the following formula can be performed only with @ISMBRWITHATTR (not with
@ISATTRIBUTE) because you specify a condition:
@ISMBRWITHATTR(Ounces,">","16")
If you specify a date attribute with the @ISMBRWITHATTR function, you must use the @TODATE
function in the string parameter to convert the date string to a number. For more information,
see the topic for the @TODATE function.
When using Boolean attributes with @ISMBRWITHATTR, use only the actual Boolean attribute
member name, or use 1 (for True or Yes) or 0 (for False or No). You cannot use True/Yes and
False/No interchangeably.
@ISPARENT
Returns TRUE if the current member is the parent of the specified member. This function excludes
the specified member.
Syntax
@ISPARENT (mbrName)
Example
@ISPARENT("New York")
@ISPARENT(Profit)
Syntax
@ISRANGENONEMPTY(ZEROASDATA|ZEROASMISSG, mbrList)
@ISSAMEGEN
Returns TRUE if the current member is the same generation as the specified member.
Syntax
@ISSAMEGEN (mbrName)
Example
@ISSAMEGEN(West)
@ISSAMEGEN(West)
@ISSAMELEV
Returns TRUE if the current member is the same level as the specified member.
Syntax
@ISSAMELEV (mbrName)
@LEVMBRS
Returns all members with the specified level number or level name in the specified dimension.
Syntax
If you specify a name for the levName parameter, Essbase looks for a level with that name in the
specified dimension.
If you specify a number for the levName parameter (for example, 2), Essbase first looks for a level
with a number string name. If no level name exists with that name, Essbase checks to see if the
parameter is a valid level number.
If you specify a temporary variable for the levName parameter, Essbase does not recognize the value
of the variable. It looks in the outline for a level name with the same name as the temporary variable.
For more information about levels and defining level names, see the Oracle Essbase Database
Administrator's Guide.
Essbase sorts the generated list of members in ascending order. Using Sample Basic as an example, if
you specify @LEVMBRS(Product,1), Essbase returns 100, 200, 300, 400, Diet (in that order). This
order is important to consider when you use the @LEVMBRS member set function with certain
forecasting and statistical functions.
If you use a negative number for the level number, no syntax error is noted, but the calculation will
fail with an error message.
The following example restricts the calculation to members with the combination Budget and one of
the members of the Market dimension with a level name of "State".
FIX (Budget,@LEVMBRS(Market,State))
ENDFIX