SUM returns the total of a selection of values calculated over a Time dimension.
NUMBER
SUM (value_expr) OVER HIERARCHY
( [ dimension | hierarchy ]
BETWEEN start AND end [WITHIN relation]
)
value_expr is a dimensional expression whose values you want to calculate.
dimension is the Time dimension over which the values are calculated.
hierarchy is the Time hierarchy over which the values are calculated. Otherwise, the default hierarchy is used.
start and end are the boundaries of the calculation, which are expressed with one of these clauses:
[UNBOUNDED | number]{ PRECEDING | FOLLOWING } identifies a range of dimension members within the group defined by relation for the calculation.
UNBOUNDED starts with the first member or ends with the last member of the group. number identifies a dimension member at a particular distance from the current member. CURRENT MEMBER starts or ends the calculation at the current member. relation can be any of the following:
PARENT calculates periods at the same level with the same parent.
LEVEL calculates periods at the same level.
ANCESTOR AT LEVEL level calculates periods at the same level and with the same parent at a specified level.
GREGORIAN YEAR calculates Time periods within the same Gregorian year.
GREGORIAN QUARTER calculates Time periods within the same Gregorian quarter.
GREGORIAN MONTH calculates Time periods within the same Gregorian month.
GREGORIAN WEEK calculates Time periods within the same Gregorian week.
SUM(GLOBAL.UNITS_CUBE.UNITS) OVER HIERARCHY (GLOBAL.TIME BETWEEN CURRENT MEMBER AND 1 FOLLOWING WITHIN PARENT)
Copyright © 2003, 2007, Oracle. All rights reserved.