dbTalk Databases Forums  

current year YTD

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


Discuss current year YTD in the microsoft.public.sqlserver.olap forum.



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

Default current year YTD - 08-01-2006 , 12:27 AM







Hi there!

Could someone please help me with this.
I urgently need a formula on getting the current year YTD.
For instance, given that I have data for 2005 and 2006. If YTD for Dec
2005 is 100 and Jan 2006 is 50, the count for Dec 2005 should not be
added to the YTD for 2006. Meaning, it will reset and the 2006 YTD
should be 50 and not 150.

I hope someone could help me. Thanks!


Reply With Quote
  #2  
Old   
yongli
 
Posts: n/a

Default RE: current year YTD - 08-04-2006 , 01:49 PM






Depending on your time dimension hierarchy. If you have a year level in your
time hiearchy, you could use YTD() function.

"kaye" wrote:

Quote:
Hi there!

Could someone please help me with this.
I urgently need a formula on getting the current year YTD.
For instance, given that I have data for 2005 and 2006. If YTD for Dec
2005 is 100 and Jan 2006 is 50, the count for Dec 2005 should not be
added to the YTD for 2006. Meaning, it will reset and the 2006 YTD
should be 50 and not 150.

I hope someone could help me. Thanks!



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

Default Re: current year YTD - 08-08-2006 , 10:38 PM




My time dimension is not really a Time Dimension. It functions just
like a normal dimension 'coz I already have a table where all possible
time hierarchies are recorded. (Year, Quarter, Semi-Annual, Month,
etc.) Can I possibly generate a YTD report for this year only using
that kind of time dimension?

yongli wrote:
Quote:
Depending on your time dimension hierarchy. If you have a year level in your
time hiearchy, you could use YTD() function.



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

Default Re: current year YTD - 08-09-2006 , 06:06 PM



Can you describe the structure of your time dimension, even if it isn't
tagged as a "Time" dimension - does it have levels like Year, Month,
Day? If so, you could probably use PeriodsToDate(), like:

PeriodsToDate([Time].[Year], [Time].CurrentMember)


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

Reply With Quote
  #5  
Old   
kaye
 
Posts: n/a

Default Re: current year YTD - 08-10-2006 , 07:40 PM




Hi Sir,

I really appreciate your reply.

My time dimension (SAT Period) only have levels Year and Month.
I tried using the PeriodsToDate but it displays an error:

Unable to update the calculated member.
Formula error - cannot convert set to Expression - in the PeriodsToDate
function.

Here's the current formula I'm using for the YTD, but it outputs YTD
count since the first recorded year, and not 2006 only:

SUM({[SAT Period].CurrentMember.Level.Members}.Item(1); [SAT
Period].CurrentMember, [Measures].[TMO])

How can I reformulate the formula I'm using right now to come up with a
YTD count for every year only?

Thanks alot Sir!


Deepak Puri wrote:
Quote:
Can you describe the structure of your time dimension, even if it isn't
tagged as a "Time" dimension - does it have levels like Year, Month,
Day? If so, you could probably use PeriodsToDate(), like:

PeriodsToDate([Time].[Year], [Time].CurrentMember)


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: current year YTD - 08-11-2006 , 08:25 AM



You can try this:

SUM(PeriodsToDate([SAT Period].[Year],
[SAT Period].CurrentMember), [Measures].[TMO])


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

Reply With Quote
  #7  
Old   
kaye
 
Posts: n/a

Default Re: current year YTD - 08-23-2006 , 10:55 PM



Sir Deepak,

Thank you so much for all the help and assistance! It worked! yey!
hehehe..
Sorry for the replying so late. I haven't checked the groups for quite
some time.

Thank you so much again! God bless.. *hugs*

- kaye Ü


Deepak Puri wrote:
Quote:
You can try this:

SUM(PeriodsToDate([SAT Period].[Year],
[SAT Period].CurrentMember), [Measures].[TMO])


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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.