Syntax Considerations
- Always use
@LEVMBRSrather than@RELATIVEif used on the entire dimension. - Use
@CHILDRENinstead of@RELATIVE, if applicable. - Use
@REMOVEand@LEVMBRSif you only want to exclude some members from a FIX statement.
Performing Calculations Using Dates Stored in Planning
Planning allows you to enter date
values. For example, using the MM/DD/YYYY format, a start date may be entered as
11/01/2019 and an end date as 06/01/2020. Oracle Essbase stores date formatted values
as numeric values. For example, the preceding start date is stored as 20191101 and
end date as 201200601. You can use Essbase functions, for example, the
@ROUND, @INT or @TRUNCATE
function, to calculate the number of months between any start date and end date. The
following example shows how to calculate the number of months between a start date
and end date using the @ROUND function:
- Calculate the number of months between the end date year and the start date year as follows:
The result of this calculation(@ROUND ("End Date",-4) - @ROUND ("Start Date",-4))/10000*12(20200000 – 20190000)/10000 *12is 12. - Calculate the number of months between the start of the end date year and the end date and add it.
The result of the calculation(@ROUND ("End Date",-2) - @ROUND ("End Date",-4))/100(20200600 – 20200000)/100is 6. - Calculate the number of months between the start of the start date year and the start date and subtract it.
The result of the calculation(@ROUND ("Start Date",-2) - @ROUND ("Start Date",-4))/100(20191100 – 20190000)/100is 11. - Combine the preceding steps into one formula
(12+6-11)to calculate the number of months (7) between the start date and end date .(((@ROUND ("End Date",-4) - @ROUND ("Start Date",-4))/10000*12) + ((@ROUND ("End Date",-2) - @ROUND ("End Date",-4))/100)- ((@ROUND ("Start Date",-2) - @ROUND ("Start Date",-4))/100))
Using the @CURRMBR Function
The @CURRMBR function, which returns the name of the dimension member currently being calculated, is especially useful for scoping and managing complex calculations. However, you must consider its performance impact.
Performance is not affected when using the @CURRMBR function on a sparse dimension because the block corresponds to one sparse dimension member only. However, the performance of this function is slower when used on a dense dimensions because it runs calculations at the block level and not at the cell level. As a result, this function calculates all the dense dimension members, even if a particular dense dimension member is not present in the query. Thus, sparingly use this function with dense dimensions.
Additionally, when used on dense dimensions, the @CURRMBR function may produce unexpected results or errors if used in conjunction with other functions such as @CONCATENATE. For example, if a dynamically calculated member in a query contains the formula "Actual"->@MEMBER(@CONCATENATE(@NAME (@CURRMBR ("Account")),"_Total")) and the Account dimension is sparse, the query will run without error as long as the account in the query generates a valid outline member. However, if the Account dimension is dense, the query results in the following error even if the account in the query generates a valid outline member.
Error executing formula for [member name] (line 0): attempt to cross a null @ member in function [@X]
This error is produced because the @CURRMBR function calculates at the block
level and therefore calculates all accounts in the dense block. Not all accounts
within the block generate a valid outline member, resulting in the preceding error
message. For more information on the @CURRMBR function, see @CURRMBR in Oracle Essbase Technical Reference.