Parallel Period

Returns a member from a previous period in the same level as the given member - for example, if January 1017 is selected, January 2016 will be returned. By default, the lag is 1, but it can be changed in script mode.

Syntax

ParallelPeriod(<model member>[, <periods to go back>][, <period type to move>][, <range to get>])

<model member>

A PQL expression that returns a single member element. The member must exist in the data source; it cannot be a custom member. For the ParallelPeriod function, select a member from a date/ time hierarchy.

<periods to go back>

A numeric value or parameter that determines the number of member positions to lag (go back). Set this value from the Insert Arguments window.

<period type to move>

The interval by which to lag; this may be years, quarters, months, weeks, or days. For instance, if you want to lag 3 quarters, the period type should be set to "Quarters".

<range to get>

The period type that should be returned; this may be a full year, full quarter, full month, full week, or a specific date. For instance, if you want to get a list of all months in the previous quarter, the range should be "Full Quarter".

Example

Here the given member element is 2010-01-01 from the "full month start date" hierarchy.

The periods to go back is set to 1, period type to move is Years, and range to get is Full Quarter. So the expression returns a list of elements from 1 year prior to 2010-01-01, at the quarter level; this is a list of all months in the same quarter as the given element (Q1), with a lag of 1 year:

{ParallelPeriod([data].[dateKey full month start date].[1262304000000],1,0,1)}

Here the periods to go back is set to 1, period type to move is Quarters, and range to get is Full Quarter. Now the expression goes back only 1 quarter from the given date, returning a list of elements 1 quarter prior to 2010-01-01, at the quarter level; this is a list of months from Q4 2009:

{ParallelPeriod([data].[dateKey full month start date].[1262304000000],1,1,1)}