## How does the lastperiods function in MDX work?

If we use Zero as the Member_Position, the MDX LastPeriods Function will return the empty set. If we use Negative Value, the LastPeriods Function will move forward to the specified value and returns the set of members up to that position, including the Member_Expression.

When does the lastperiods function return a member?

A valid Multidimensional Expressions (MDX) expression that returns a member. If the specified number of periods is positive, the LastPeriods function returns a set of members that start with the member that lags Index – 1 from the specified member expression, and ends with the specified member.

### What happens if no dimension is specified in lastperiods?

This is unlike the Lag function, which returns the specified member if 0 is specified. If a member is not specified, the LastPeriods function uses Time.CurrentMember. If no dimension is marked as a Time dimension, the function will parse and execute without an error, but will cause a cell error in the client application.

Which is the default value for lastperiods ( )?

The following example returns the default measure value for the second third, and fourth fiscal quarters of fiscal year 2002. SELECT LastPeriods (3, [Date]. [Fiscal].

If we use Zero as the Member_Position, the MDX LastPeriods Function will return the empty set. If we use Negative Value, the LastPeriods Function will move forward to the specified value and returns the set of members up to that position, including the Member_Expression.

A valid Multidimensional Expressions (MDX) expression that returns a member. If the specified number of periods is positive, the LastPeriods function returns a set of members that start with the member that lags Index – 1 from the specified member expression, and ends with the specified member.

This is unlike the Lag function, which returns the specified member if 0 is specified. If a member is not specified, the LastPeriods function uses Time.CurrentMember. If no dimension is marked as a Time dimension, the function will parse and execute without an error, but will cause a cell error in the client application.

The following example returns the default measure value for the second third, and fourth fiscal quarters of fiscal year 2002. SELECT LastPeriods (3, [Date]. [Fiscal].