Home      Functions     Common Solutions      Contact     






MDX Functions:
 
MDX Functions

 
Common Solutions

Common Solutions
 
Resource Links

MDX Books
MDX Related Software
MDX Related Blogs
 
Other Links

Contact Us
 
Microsoft SQL Server Analysis Services Function Page
Function Name: LastPeriods
Category: Time
Description: The LastPeriods function returns the supplied number of members up to and including the supplied member.
Syntax: LASTPERIODS( «Index»[, «Member»] )
Technet Link: MDX LastPeriods Function




The query below returns a total of five members. The first four members are before the supplied member of October 2003 in the Fiscal hierarchy in the Date dimension.
 

SELECT
      {} ON COLUMNS,
      LastPeriods(5,[Date].[Fiscal].[Month].[October 2003]) ON ROWS
FROM
      [Adventure Works]
 
 

 
The following query returns the first 15 days of January 2003 in the Calendar hierarchy in the Date dimension.
 

SELECT
      {} ON COLUMNS,
      LastPeriods(15,[Date].[Calendar].[January 15, 2003]) ON ROWS
FROM
      [Adventure Works]
 
 

 
 

 
Copyright 2008 by MDXpert.com.
 
Terms of Use                              Privacy Statement
 
Site Powered By - WinHost.Com