Showing posts with label all posts. Show all posts
Showing posts with label all posts. Show all posts

Sunday, November 3, 2013

Age at January first each year

CREATE MEMBER CURRENTCUBE.[Measures].[Age jan1]
AS Datediff("yyyy",[Customer].[Birth Date].CurrentMember.Name, CDATE("01/01/"+ right([Date].[Calendar Year].CurrentMember.Member_value,4))),
VISIBLE = 1, DISPLAY_FOLDER = 'Ages' ;

Till Next Time

SSAS Ages at current date

CREATE MEMBER CURRENTCUBE.[Measures].[Age Years]
AS Datediff("yyyy",[Customer].[Birth Date].CurrentMember.Name, NOW()),
VISIBLE = 1, DISPLAY_FOLDER = 'Ages' ;

CREATE MEMBER CURRENTCUBE.[Measures].[Age Months]
AS Datediff("M",[Customer].[Birth Date].CurrentMember.Name, NOW()),
VISIBLE = 1 , DISPLAY_FOLDER = 'Ages' ; 

CREATE MEMBER CURRENTCUBE.[Measures].[Age Months To Years]
 AS Datediff("M",[Customer].[Birth Date].CurrentMember.Name, NOW())/12,
FORMAT_STRING = "#.##0,0",
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Ages'  ; 

CREATE MEMBER CURRENTCUBE.[Measures].[Age Days]
AS Datediff("d",[Customer].[Birth Date].CurrentMember.Name, NOW()),
VISIBLE = 1, DISPLAY_FOLDER = 'Ages' ;

Till Next Time