Question

In regard to the default values in a dimensional model, as shown here does anyone have suggestions about best practices to generate these values?

Do you see them related to the Data Warehouse database or to the ETL process?

Suppose we have a MS solution would you have them as a post deployment script in the DW Sql Server database project or some how added to the dimension tables in the ETL Integration Services project? In case of the later, how can one generate rows at runtime?

Was it helpful?

Solution

Usually, the defaults are not auto-generated at all. When I model a dimension that's going to have a "unknown" value, or a "none" value, since my keys are nearly always positive bigints, i just use "-1" as the id for "Unknown" and "0" for "None". You could even add a "-2" for "Data not yet available" or some such.

I usually include these inserts as part of the installation script for the DDL of a new dimension table, and just be sure that my auto-numbering system (whichever DBMS we're using) starts at 1.

During your ETL process for a fact which assigns dimension keys, if you read a source table and find conditions to indicate that a value is "Unknown", then you assign the -1 to that dimension value. If you find conditions that indicate the value is "None", then you assign the 0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top