Search code examples
data-warehousedimensional-modeling

How do I dimensionally model this relationship in a Kimball-style data warehouse?


So I have two dimensions in my data warehouse:

dim_machine
-------------
machine_key
machine_name
machine_type


dim_tool
------------
tool_key
tool_name
machine_type

What I want to make sure of is the machine_type field in both dimensions has the same data. Should I create a third dimension to snowflake between the two or is there another alternative?


Solution

  • I'm not sure exactly what problem you're trying to solve? This sounds like something that you would simply build into the ETL process: for both dimensions, map your source data to the same target list of machine types. If a new value appears that has no mapping, raise an error (or set a default placeholder value and review the data later).

    A completely different option would be a "mini-dimension" (Kimball's term), that holds all possible machine/tool combinations. If two dimensions are closely related and often used together in searches then it can be useful way to consolidate and simplify them. But even then, I assume you will be checking and cleaning the source data to conform the machine types.