The @CURRMBRRANGE() function generates a member list that is based on the relative position of the current member being calculated.
@CURRMBRRANGE(dimName, {GEN|LEV}, genLevNum, [startOffset], [endOffset])
dimName | Name of the dimension for which you want to return the range list. |
GEN|LEV | Defines whether the range list to be returned is based on a generation or a level within the dimension. |
genLevNum | Integer value that defines the absolute generation or level number of the range list to be returned. |
startOffset | Defines the first member in the range to be returned.
|
endOffset | Defines the last member in the range to be returned.
|
@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.
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 the rangeList 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 Opening Inventory 100 110 120 130 . . . 200 210 Average Inventory 105 110 115 120 . . ..155 155Since a null value is specified for startOffset, the average operations always begin at the first member of the range list, Jan. The endOffset parameter, 1, specifies that the member after the current member being calculated is included in each average operation. So, for Average Inventory->Jan, the values for Jan and Feb are averaged; for
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 Average Inventory 110 116.7 122.5 126 Sales 40 44 48 52 Turnover 0.36 0.72 1.08 1.46
Copyright (c)1991-2000 Hyperion Solutions Corporation. All rights reserved.