dbTalk Databases Forums  

YTD Sum of last day in month.

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss YTD Sum of last day in month. in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BvR
 
Posts: n/a

Default YTD Sum of last day in month. - 01-18-2006 , 09:41 AM






Hi,

My report will run on the last day of every month and display MTD and YTD
figures. For one measure though the YTD must only sum the last day in every
month.
For example on the 30/09/2005, I need to sum the measure's value for the
last day in every month from Jan to Sep.
My date dimension consists of Year->Qrt->Month->Week->Day.

Thanks
BvR



Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: YTD Sum of last day in month. - 01-18-2006 , 06:31 PM






Maybe something like:

Quote:
Sum(Generate(YTD(Ancestor([Date].CurrentMember,
[Date].[Month])), Tail(Descendants([Date].CurrentMember,
[Date].[Day])), [Measures].[ClosingVal])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
BvR
 
Posts: n/a

Default RE: YTD Sum of last day in month. - 01-19-2006 , 04:10 AM



Thanks Deepak, that works fine.
"BvR" wrote:

Quote:
Hi,

My report will run on the last day of every month and display MTD and YTD
figures. For one measure though the YTD must only sum the last day in every
month.
For example on the 30/09/2005, I need to sum the measure's value for the
last day in every month from Jan to Sep.
My date dimension consists of Year->Qrt->Month->Week->Day.

Thanks
BvR



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.