Skip to content

Role-Playing Dimension

Sometimes, a single physical dimension table is joined to a fact table multiple times, with each join representing a different logical view of the dimension. These separate views (with unique attribute column names) are called "roles".

Example (Dates in an Order Fact Table):

Instead of creating three separate date tables for ordering, shipping and delivering, you use SQL aliases to join the exact same dim_date table three times.

order_idorder_date_keyship_date_keydelivery_date_key
9001202401012024010320240105
9002202401022024010220240106

Each foreign key represents a different role and references the appropriate row in the shared Conformed Date Dimension.

Overlapping Dimension Classifications

Dimension classifications are not necessarily mutually exclusive. A dimension can have multiple characteristics at the same time. For example, dim_date can be both a conformed dimension and a role-playing dimension.

Multiple Time Zones

To capture both universal standard time (UTC) as well as local times in multi-time zone applications, dual foreign keys should be placed in the affected fact tables. These keys join to two role-playing date (and potentially time-of-day) dimension tables, allowing users to slice facts either by the absolute global time or by the local time where the event occurred.

fact_idutc_date_keylocal_date_keysales_amount
1002026010120251231$50.00