Go to primary content

Period To Date

Calculates the values up to the current period within an ancestor or within a level.

The template presents an ancestor or a level for a measure of the analytic view, an attribute dimension the analytic view is dimensioned by, a hierarchy that uses the attribute dimension, an aggregation operator, and the beginning or end of the period. To select a different value for an option, click the underlined value in the template and make a selection from the Select Measures dialog box or the drop-down list.

Template

{ Level | parent | ancestor at level level name } to date for the measure name measure for the attribute dimension alias attribute dimension and the hierarchy alias hierarchy. Aggregate using { SUM | MAXIMUM | MINIMUM | AVERAGE } from the { beginning | end } of the period.

Example: Example of Period To Date

The sales_to_date calculated measure calculates the sum of the measure values for the hierarchy members that have the same ancestor at the year level from the beginning of the period to the current member.

Calculation in Template

Ancestor at level YEAR to date for the SALES measure in the TIME_ATTR_DIM attribute dimension and TIME.HIER hierarchy. Aggregate using SUM from the beginning of the period.

Definition of Calculated Measure in Analytic View

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

sales_to_date AS LAG (SALES) OVER (HIERARCHY TIME_HIER OFFSET 1)

SELECT Statement Using the Calculated Measure

Query the analytic view, selecting sales and sales_to_date values.

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

Results of the Query

TIME      SALES          SALES_TO_DATE
--------  -------------  -------------
Q1CY2011  1625299627.35  1625299627.35
Q2CY2011  1715160208.04  3340459835.39
Q3CY2011  1691017692.94  5031477528.33
Q4CY2011   1723638452.4  6755115980.73
Q1CY2012  1644857783.16  1644857783.16
Q2CY2012  1752414181.93  3397271965.09
Q3CY2012  1732373411.73  5129645376.82
Q4CY2012  1772037022.13  6901682398.95
Q1CY2013  1723571457.57  1723571457.57
Q2CY2013  1840985832.41  3564557289.98
Q3CY2013  1821918663.55  5386475953.53
Q4CY2013  1854462764.04  7240938717.57
Q1CY2014  1809855822.43  1809855822.43
Q2CY2014  1929427228.69  3739283051.12
Q3CY2014  1900013511.05  5639296562.17
Q4CY2014  1940449790.72  7579746352.89
Q1CY2015  1908099572.68  1908099572.68
Q2CY2015  2018132032.81  3926231605.49
Q3CY2015  1989225698.61   5915457304.1
Q4CY2015  2025645581.05  7941102885.15