Home > OLAP Calculation Templates > Period to Date > Period to Date Period Ago
![]() Previous |
![]() Next |
Calculates the values up to a previous time period within an ancestor, such as Quarter or Year, or within a Gregorian level.
Gregorian level | ancestor at level level } to date number periods ago for measure (...) in the time dimension and time hierarchy. Aggregate using { SUM | MINIMUM |AVERAGE } from the { beginning | end } of the period.
This calculated measure computes a running total of Units from the first time period to the previous period within fiscal years.
Ancestor at level TIME.FISCAL_YEAR to date 1 period ago for UNITS(...) in the TIME dimension and TIME.FISCAL hierarchy. Aggregate using SUM from the beginning of the period.
LAG(SUM(UNITS_CUBE.UNITS) OVER HIERARCHY (TIME.FISCAL BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT LEVEL TIME.FISCAL_YEAR), 1) OVER HIERARCHY (TIME.FISCAL)
The Period Ago column shows a running total within fiscal years. Q1 FY-05 to Q4 FY-05 are calculated together, and Q1 FY-06 to Q4 FY-06 are calculated together. FY2005 and FY2006 are calculated with all other fiscal years.
Time Parent Units To Date Period Ago -------- -------- -------- -------- ---------- Q1 FY-05 FY2005 148292 148292 576246 Q2 FY-05 FY2005 149528 297820 148292 Q3 FY-05 FY2005 143607 441427 297820 Q4 FY-05 FY2005 138096 579523 441427 Q1 FY-06 FY2006 138953 138953 579523 Q2 FY-06 FY2006 145062 284015 138953 Q3 FY-06 FY2006 146819 430834 284015 Q4 FY-06 FY2006 145233 576067 430834 FY2005 TOTAL 579523 579523 576246 FY2006 TOTAL 576067 576067 579523