Beruflich Dokumente
Kultur Dokumente
FROM TECHREF
@CURRMBR
Returns the member that is currently being calculated in the specified dimension (dimName). This function
can be used as a parameter of another function, where that parameter is a single member or a list of members.
Syntax
@CURRMBR (dimName)
Parameter
dimName
Description
A single dimension name.
Notes
You cannot use the @CURRMBR function in a FIX statement.
You cannot use the @CURRMBR function on the left-hand side of a formula.
The time required for retrieval and calculation may be significantly longer if this function is in a formula attached
to a member tagged as Dynamic Calc or Dynamic Calc and Store.
Example
In the Sample Basic database,
@CURRMBR(Year);
This formula populates each upper-level member of the Product dimension (100, 200) at Average Sales. To
calculate Average Sales, the Sales values for the level 0 members of Product are averaged and placed in their
respective parent members. The Average Sales values for the level 0 Product members are the same as the
Sales values, as specified by the IF statement in the calculation script.
This example produces the following report:
Jan
New York
Sales
Actual
Average Sales
=====
=============
100-10
100-20
10
10
100-30
15
15
100
30
10
200-10
20
20
200-20
25
25
200-30
30
30
200-40
35
35
200
110
27.5
300
#MI
#MI
400
#MI
#MI
Diet
35
11.67
Product
140
35
@CURRMBRRANGE
Generates a member list that is based on the relative position of the current member being calculated.
Syntax
@CURRMBRRANGE (dimName, {GEN|LEV}, genLevNum, [startOffset], [endOffset])
Parameter
dimName
GEN|LEV
genLevNu
m
startOffset
Description
Name of the dimension for which you want to return the range list.
Defines whether the range list to be returned is based on a generation or a level within the
dimension.
Integer value that defines the absolute generation or level number of the range list to be returned.
Defines the first member in the range to be returned.
A null value returns the first member of the specified genLevNum.
An integer value returns the member name relative to the current member being calculated.
endOffset
A negative value specifies a member prior to the current member being calculated in the
dimension.
A value of 0 returns the name of the member currently being calculated.
A positive value specifies a member after the current member being calculated in the dimension.
Defines the last member in the range to be returned.
A null value returns the last member of the specified genLevNum.
An integer value returns the member name relative to the current member being calculated.
A negative value specifies a member prior to the current member being calculated in the
dimension.
A value of 0 returns the name of the member currently being calculated.
A positive value specifies a member after the current member being calculated in the dimension.
Notes
You cannot use the @CURRMBRRANGE function in a FIX statement.
The first three parameters of this function (dimName,{GEN|LEV},genLevNum) provide a member range list.
The startOffset and endOffsetparameters create a subset of this list. For example, consider the following syntax in the
context of the Sample Basic database:
@CURRMBRRANGE(Year,LEV,0,-1,1)
In this example, the full range list contains the level 0 members of the Year dimension (Jan, Feb, Mar, Apr, May, Jun,
Jul, Aug, Sep, Oct, Nov, Dec). If the current member being calculated in the Year dimension is Jan,
the startOffset and endOffset parameters reduce this list to (Jan, Feb). Since there is no member prior to Jan in the
full range list, only two members are returned: Jan itself and the member after it, Feb. If the current member being
calculated is Feb, the subset list would include three members: Jan, Feb, Mar.
Currently, this function can be used only within range and financial functions, such as @AVGRANGE,
@MAXRANGE, @COMPOUND, and @SHIFT.
Example
Example 1
Average Inventory is calculated by summing opening inventories from the first month of the year to the current period
plus one period, and dividing the result by the number of periods to date plus one period. This calculation is
accomplished by defining the @CURRMBRRANGE function within therangeList parameter of the @AVGRANGE
function.
"Average Inventory" = @AVGRANGE(SKIPNONE,"Opening Inventory",
@CURRMBRRANGE(Year, LEV, 0, , 1));
This example produces the following result:
Jan Feb Mar Apr
Nov Dec
Inventory->Feb, the values for Jan, Feb, and Mar are averaged; and so on. The values for Nov and Dec are the same
since there is no member after Dec in the range list.
Example 2
Inventory Turnover is calculated by summing period-to-date Sales and dividing the result by the Average Inventory.
Turnover = @SUMRANGE(Sales,@CURRMBRRANGE(Year, LEV, 0, , 0))/"Average Inventory"
which produces the following result:
Jan
Feb
Mar
Apr
Sales
40
44
Turnover
0.36 0.72
48
1.08
52
1.46
Example 3
Consider the following formula:
@CURRMBRRANGE(Year,LEV,@CURLEV("Year"),-1,1)
The full range list contains the members of the Year dimension at a particular level. The level is determined by taking
the level of the current member being calculated. For example, if the current member being calculated is Jan, the full
range list contains all level 0 members of Year dimension (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov,
Dec). The startOffset and endOffset parameters reduce this list to (Jan, Feb). As there is no member prior to Jan in
the full range list, only two members are returned: Jan and Feb. If the current member being calculated is Feb, the
subset list includes three members: Jan, Feb, Mar.
Note:
The usage demonstrated by this example would require RTDEPCALCOPTIMIZE to be set to FALSE.
("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 will result 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]
The error is produced because the @CURRMBR function calculates at the block level and therefore calculates on all
accounts in the dense block. Not all accounts within the block will generate a valid outline member, resulting in the
error message above.
@CURRMBR IN ALLOCATIONS
Often times with a Hyperion Essbase or Planning application, an allocation of data will be required. Many times, the
allocation is simply moving data from one member to another. When the number of members involved is large,
developing the script can be time consuming. When the members frequently change, the maintenance of the
calculation can be a nuisance.
When the members involved in the allocation are similar on both sides (the from and the to), the following method
can be employed to speed the development and limit, or eliminate, any maintenance required.
Requirement
The application has 50 members in which the data needs to be moved. The data originates from an account coming
from the general ledger. The data needs to be moved to a new member that doesnt exist in the chart of accounts.
The new member will exist in a different part of the hierarchy.
Solution
The first step is to create a corresponding member for each of the 50 accounts that need allocated. These accounts
will be identical to the original 50, except they will be prefixed with a D identifying them as a dummy, or made up,
account. Each of these new accounts will have a UDA of allocation. The prefix of the member and the UDA are not
critical. They will likely be something more meaningful to the requirements.
GL Acct
Dummy Account
500345
D500345
500578
D500578
607878
D607878
Once the hierarchy is ready to handle the allocation, the following function can be used. In layman's terms, this only
executes on the new members added (identified by the unique UDA) and makes them equal to the corresponding
member without the added prefix. We will assume that this is being executed on a scenario that equals Actuals.
FIX(@UDA(allocation))
/* Make the new member equal to the old member */
Actuals = @MEMBER ( @SUBSTRING ( @NAME(@CURRMBR("Account")) , 1));
/* Clear the old member */
@MEMBER ( @SUBSTRING ( @NAME(@CURRMBR("Account")) , 1)) = #Missing;
ENDFIX
Lets assume that the UDA is NOT added to the new, or dummy, member. If the UDA is on the originating member,
the calculation would look like this.
FIX(@UDA(allocation))
/* Make the new member equal to the old member */
OTHER USAGES
Transhipments
In some Essbase models there is a need to capture two essentially identical elements in separate dimensions. One
common example of this is a transhipment model, where it is necessary to identify both the origination and
destination of a shipment.
Two Dimensions
The most straightforward, and often user-friendly, manner to accomplish this type of tracking is to have the same
hierarchy in two dimensions, with each member prefixed differently (i.e. the Source location members might be
prefixed with "TO:" while the Destination members would be prefixed with "FROM:").
Net Shipments
A simple metric to consider in this type of model is often Net Shipments. In a multidimensional database, to calculate
Net Shipments, shipments out of a location needs to be subtracted from shipments in (or vice-versa, depending on
your preference). Assuming this is being calculated for Location A, the formula might look like:
Shipments -> TO:A -> Total Sources - Shipments -> From:A -> Total Destinations
(I.E. take all of the shipments that are sent to "A", regardless of where they are from, and subtract all of the shipments
from "A" regardless of where they go to).
The Problem
The formula is simple and straightforward for one location, and remains similar for all other locations, but, every time
a location is added, renamed, or deleted the calculation must be updated manually.
The Solution
Assuming the hierarchies are carefully constructed to always require "TO:" before the source location and "FROM:"
before the destination location, Essbase can programatically determine the corresponding member by removing and
replacing the prefix.
Components
Several string manipulation functions are required:
@NAME or @ALIAS: Used to pass either an Essbase Member Name or the respective member's Alias
Name to another function as a string.
For this example, I'll also utilize @CURRMBR. This function returns the current member being calculated from a
given dimension.
So, to determine the corresponding destination from a member in the source dimension:
1.
2.
3.
4.
Using this formula, you can fix on the portion of a hierarchy in the Source dimension, and have access to each
member's corresponding Destination member. The original example of calculating Net Shipments might look like:
Fix(@RELATIVE("Source",0))
"Net Shipments"(
"Shipments"->"Total Destination" - "Shipments"->"Total Source">@MEMBER(@CONCATENATE("FROM:",@SUBSTRING(@NAME(@CURRMBR("Source")),3)));
);
ENDFIX