dbTalk Databases Forums  

Newbie question regarding relative dates

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


Discuss Newbie question regarding relative dates in the microsoft.public.sqlserver.olap forum.



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

Default Newbie question regarding relative dates - 12-10-2005 , 12:43 PM






I'm absolutely new to Analysis Services and wanted to pose this question
hoping that an expert could look it over and point me in the right direction
if I am doing the wrong thing.

I have a fact table which holds a statistical value 'Score' at the year
level. I need to be able to diplay scores for each year and also a year to
date
score. I've read the excellent article by William Pearson on relative dates

http://databasejournal.com/features/...0894_3518771_5

and I was going to go about this by creating a table that defines year
like so

Year_ID Year_Value
1 2002
2 2003
3 2004
4 2005 Year to Date

and then from fact table create a view for each year (adding Year_ID field
or joining to Year definition table)

vw_Fact_Year1 select * from Fact where Year_ID = 1
vw_Fact_Year2 select * from Fact where Year_ID = 2
vw_Fact_Year3 select * from Fact where Year_ID = 3
vw_Fact_YTD select * from Fact where Year_ID = 4

and finally the in Analysis Services create measures for Score based on Fact
year views...

Year
2002 2003 2004 2005
Score Year1 Score Year 2 Score Year 3 Score YTD
52 53 66 80

Is this generally the right way to go?


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.