Go to primary content

Moving Minimum

Returns the smallest value among a fixed number of consecutive periods surrounding the current period.

The template presents a measure of the analytic view, an attribute dimension the analytic view is dimensioned by, a hierarchy that uses the attribute dimension, numbers that specify the number of members before and after the current member, and a level. To select a different value, click the underlined value in the template and make a selection from the Select Measures dialog box or the drop-down list or enter a different number value.

Template

Moving minimum for measure name measure for the attribute dimension alias attribute dimension and the hierarchy name hierarchy. Include number preceding and number following members within { level | parent | ancestor at level level name }.

Example: Example of Moving Minimum

The units_mov_min calculated measure returns the minimum number of units within the range of time periods that include: the current time period, the previous period, if any, and the next time period, if any.

Calculation in Template

Moving minimum for the UNITS measure for the TIME_ATTR_DIM dimension and TIME_HIER hierarchy. Include 1 preceding and 1 following members within ancestor at level YEAR.

Definition of Calculated Measure in Analytic View

The MEASURES clause of the SALES_AV analytic view definition includes this definition of the units_mov_min calculated measure:

units_mov_min AS 
  MIN (UNITS)
      OVER (HIERARCHY TIME_ATTR_DIM.TIME_HIER 
        BETWEEN 1 PRECEDING AND 1 FOLLOWING 
        WITHIN ANCESTOR AT LEVEL YEAR)

SELECT Statement Using the Calculated Measure

SELECT time_hier.member_name as TIME,
 units,
 units_mov_min
FROM
 sales_av HIERARCHIES(time_hier)
 WHERE time_hier.level_name IN ('QUARTER')
ORDER BY time_hier.hier_order;

Results of the Query

TIME           UNITS  UNITS_MOV_MIN
--------  ----------  -------------
Q1CY2011     5892326        5892326
Q2CY2011     6169477        5892326
Q3CY2011     6139928        6139928
Q4CY2011     6260713        6139928
Q1CY2012     5826552        5826552
Q2CY2012     6168051        5826552
Q3CY2012     6141546        6141546
Q4CY2012     6264470        6141546
Q1CY2013     5826437        5826437
Q2CY2013     6172471        5826437
Q3CY2013     6145133        6145133
Q4CY2013     6263218        6145133
Q1CY2014     5828440        5828440
Q2CY2014     6171282        5828440
Q3CY2014     6139089        6139089
Q4CY2014     6263855        6139089
Q1CY2015     5895598        5895598
Q2CY2015     6172365        5895598
Q3CY2015     6142640        6142640
Q4CY2015     6264603        6142640