We have to just set the early arriving fact as “unknown” and set it to a unknown dimension key (usually –1) in the fact table.
Another option we can use is the idea of an inferred dimension. As you load your fact table data you do a lookup to your dimension.
If you have a match, cool, take that key and move on. If you don’t have a match, instead of setting the key to –1 (unknown), do this:
1) Insert a new dimension record with your business key from your fact table
2) Grab the newly created dimension key from the record you just inserted
3) Merge the key back into your fact data pipeline.
Another option we can use is the idea of an inferred dimension. As you load your fact table data you do a lookup to your dimension.
If you have a match, cool, take that key and move on. If you don’t have a match, instead of setting the key to –1 (unknown), do this:
1) Insert a new dimension record with your business key from your fact table
2) Grab the newly created dimension key from the record you just inserted
3) Merge the key back into your fact data pipeline.
No comments:
Post a Comment