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: IsGeneration
Category: Navigation
Description: The IsGeneration function returns either true or false depending on whether the supplied member is in a supplied generation.
Syntax: ISGENERATION( «Member»,«Numeric Expression» )
Technet Link: MDX IsGeneration Function




The query below returns True or False if the current member of the Calendar hierarchy is at the first generation. The first generation is the month level.
 
WITH
      MEMBER [Measures].[IsAGen] AS
      ISGENERATION([Date].[Calendar].CurrentMember, 1)
SELECT
      {[Measures].[IsAGen]} ON COLUMNS,
      {[Date].[Calendar].AllMembers} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below returns True or False if the current member of the Calendar hierarchy is at the third generation. The third generation is the Calendar Semester level.
 
WITH
      MEMBER [Measures].[IsAGen] AS
      ISGENERATION([Date].[Calendar].CurrentMember, 3)
SELECT
      {[Measures].[IsAGen]} ON COLUMNS,
      {[Date].[Calendar].AllMembers} ON ROWS
FROM
      [Adventure Works]
 
 

 
The following query uses Filter function along with the IsGeneration function to return all members from the fourth generation (Calendar Year level).
 

SELECT
      {} ON COLUMNS,
      FILTER({[Date].[Calendar].AllMembers}, ISGENERATION([Date].[Calendar].CurrentMember, 4)) ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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