Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Role Playing dimensions

3 posters

Go down

Role Playing dimensions Empty Role Playing dimensions

Post  arfoot653@gmail.com 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

Back to top Go down

Role Playing dimensions Empty Re: Role Playing dimensions

Post  ngalemmo 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.
ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

Role Playing dimensions Empty Re: Role Playing dimensions

Post  Vishy 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

Back to top Go down

Role Playing dimensions Empty Re: Role Playing dimensions

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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