LastPeriods (PEL)

This function returns a set of members from the sequence of members in a specified member level that begins or ends with the member.

Member_Expression.LastPeriods( Index )

Parameters

  • Member_Expression
    A valid PerformancePoint Expression Language (PEL) expression that returns a member
  • Index
    A valid integer expression that specifies a number of periods

Return value

The following list describes the possible return values for LastPeriods:

  • If Index is positive, the LastPeriods function returns a set of members that starts with the member that lags (Index - 1) from Member_Expression and ends with the specified member. The number of members returned by the function is equal to Index.

    That is, if Index is positive, LastPeriods is defined as

    Member_Expression.Lag(Index – 1) : Member_Expression

  • If Index is zero, the LastPeriods function returns an empty set. This is unlike the Lag (PEL) function, which returns the specified member if 0 is specified.

  • If Index is negative, the LastPeriods function returns a set of members that starts with Member_Expression and ends with the member that leads (-Index - 1) from the specified member. The number of members returned by the function is equal to the absolute value of Index.

    That is, if Index is negative, LastPeriods is defined as

    Member_Expression:Member_Expression.Lead(-Index - 1)

Remarks

The PEL compiler can generate SQL code for this function when the function is part of an absolute reference. The compiler cannot generate SQL code when the function is part of a relative reference.

PEL cannot be used to reference user-created member views in non-time dimensions. To write a business rule that references a member view in a non-time dimension, use a native Multidimensional Expressions (MDX) implementation.

See Also

Reference

Lag (PEL)
SQL generation for PEL functions

Other Resources

PEL reference
Multidimensional Expressions (MDX) Reference on MSDN