Storage of dimension values
3 posters
Page 1 of 1
Storage of dimension values
I have a fact table with orders that contains a field what kind of order it is. There are only five values that can be possible to be filled out in this field ("Unknown", "Web order", "Phone order", "Email order" and "Fax order"). What would be the best way to model this?
1. Create a lookup table with an ID and name that has five rows and put an integer with a foreign key to this lookup table in the fact table
2. Put the textual description as above in the fact table and build the dimensions from the distinct values from this column
3. Other options??
Thanks.
1. Create a lookup table with an ID and name that has five rows and put an integer with a foreign key to this lookup table in the fact table
2. Put the textual description as above in the fact table and build the dimensions from the distinct values from this column
3. Other options??
Thanks.
emonchen- Posts : 12
Join date : 2010-02-11
Age : 46
Location : Delft, The Netherlands
Re: Storage of dimension values
Your lookup table is called a dimension. Put distinct values in the dimension, create a surrogate key as the primary key and create a one to many relationship to the fact table.
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: Storage of dimension values
As B&L pointed out, option 1 is creating a dimension table for the order type.
Option 2 is strongly discouraged.
Another option would be to include the attribute (code and description) in another dimension if appropriate.
Option 2 is strongly discouraged.
Another option would be to include the attribute (code and description) in another dimension if appropriate.
Similar topics
» Source Values and Conformed Values in the Dimension table
» One-to-many dimension values
» Textual values in dimension tables
» Large Degenerate Dimension Values
» Lab Result values in Fact Table has int and non int values
» One-to-many dimension values
» Textual values in dimension tables
» Large Degenerate Dimension Values
» Lab Result values in Fact Table has int and non int values
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum