LastPeriods

Analysis Services

Analysis Services

LastPeriods

Returns a set of members prior to and including a specified member.

Syntax

LastPeriods(«Index»[, «Member»])

Remarks

If «Member» is not specified, it is Time.CurrentMember.

If «Index» is positive, returns the set of «Index» members ending with «Member» and starting with the member lagging «Index» - 1 from «Member».

If «Index» is negative, returns the set of (- «Index») members starting with «Member» and ending with the member leading (- «Index» - 1) from «Member».

If «Index» is zero, the empty set is returned.

Examples

The following table lists possible uses of the LastPeriods function.

Expression Returns
LastPeriods(2, [1997June])
{[1997May], [1997June]}
LastPeriods(-2, [1997June])
{[1997June], [1997July]}
LastPeriods(1, [1997June])
{[1997June]}
LastPeriods(-1, [1997June])
{[1997June]}
LastPeriods(0, [1997June])
Empty set