Role Playing dimensions

View previous topic View next topic Go down

Role Playing dimensions

Post  arfoot653@gmail.com on Sun Feb 26, 2012 8:49 am

Whats the best way to create role playing aliases for date dimension in db2? Aliases in db2 doesn't allow renaming of columns to a different name compared to the base table. Views can be used to create aliases, but is there a better way to do this?

arfoot653@gmail.com

Posts : 9
Join date : 2012-02-01

View user profile

Back to top Go down

Re: Role Playing dimensions

Post  ngalemmo on Mon Feb 27, 2012 2:50 pm

Just change the name in the fact table. I prefix the normal PK column name with the role. For example, a date dimension has a PK named 'date_key'. If I have an order fact table with a few dates, I would name the columns 'order_date_key', 'requested_ship_date_key', etc...

The database doesn't care. Most modeling tools allow you to specify the role name in the relationship. Any decent BI or reporting tool will add aliases to the SQL as necessary. If you must, you can always define a synonym for each unique role, but that is only necessary if users are coding SQL.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Role Playing dimensions

Post  Vishy on Wed Feb 29, 2012 1:00 pm

you need not worry about it , any BI tool will do that for you.
But sugested by ngalemmo just make sure you have different different FK's in fact for all the roles

Vishy

Posts : 75
Join date : 2012-02-28
Location : India

View user profile

Back to top Go down

Re: Role Playing dimensions

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum