Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Just to let you know...what a great site you have. I posted a pretty generic question yesterday and have had 8 responses already, anyway thanks again and keep up the good work..."

Geography

Where in the world do Tek-Tips members come from?
Olekova (TechnicalUser)
8 Nov 11 9:07
Hello,

I have two fact tables with a different time granularity.

First fact table has the grain month, second has the grain quarterly. Should they use the same time dimension, or should I have a time dimension for each granularity?

If I have a time dimension like this

key year quarter month
1 2010 q1-2010 january
2 2010 q1-2010 february
3 2010 q1-2010 march

If always should this as the time dimension for every granularity, how would you connect a fact table with the grain quarterly? Would you always use the first key in the quarter(here 1) or the last key (3)?

Thanks a lot for your help!!

Olekova
blom0344 (TechnicalUser)
8 Nov 11 14:44
If the reporting end uses sophisticated BI tools like BO or Cognos and multi-fact querying is an option then 1 dimension would suffice (as these tools can handle multi-grain) Otherwise you can define a time table at the lowest grain and define views against it to suit higher levels..

Ties Blom
 
 

Olekova (TechnicalUser)
8 Nov 11 22:31
Tanks for tue answer. What i do not understand is how i should generate the foreign key in a fact table with quarterly grain. Could u help me there?
Thanks!

Olekova
blom0344 (TechnicalUser)
9 Nov 11 2:46
A key should preferably be an integer, so in my ETL I would build something like (example in T-SQL) (prior to aggregatestep to quarter-level):

case
when month(somedate) between 1 and 3
then year(somedate)*100+1
when month(somedate) between 4 and 6
then year(somedate)*100+2
when month(somedate) between 7 and 9
then year(somedate)*100+3
when month(somedate) between 10 and 12
then year(somedate)*100+4
else 0
end

for 2011 this yields:

201101 (first quarter)
201102 (2nd quarter)
201103 (3rd quarter)
201104 (4th quarter)
 

Ties Blom
 
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close