In this scenario, the data architect is loading two tables, Orders and Shipments, into Qlik Sense, and a synthetic key is being generated due to the presence of shared fields (OrderID and LineNo) between these tables.
Understanding the Issue:
Synthetic Keys: Qlik Sense automatically creates synthetic keys when two or more tables share multiple fields with the same names. While synthetic keys aren't necessarily problematic, they can sometimes lead to incorrect or unexpected data associations and should be resolved when possible to maintain clarity and control over the data model.
The tables Orders and Shipments share the fields OrderID and LineNo. In this context, these fields together uniquely identify each record, so they are both necessary for accurate data linkage.
Correct Resolution Approach:
Option C: Create a composite key using OrderID and LineNois the best approach.
Here's why:
Composite Key Creation:
By creating a composite key that combines OrderID and LineNo (e.g., OrderID & '-' & LineNo), you ensure that each line in the orders and shipments tables is uniquely identified. This composite key will accurately link the related records from the Orders and Shipments tables.
Avoiding Synthetic Keys:
By manually creating this composite key, you eliminate the need for Qlik Sense to generate a synthetic key, thereby simplifying the data model and ensuring that data associations are clear and controlled.
Retaining Both Fields:
This approach allows you to keep both OrderID and LineNo as separate fields in your tables if needed for other analyses or reporting purposes, while using the composite key for linking the tables.
References:
Qlik Sense Data Modeling Best Practices: When dealing with multiple fields that are used together to uniquely identify records, it is recommended to create composite keys rather than relying on Qlik Sense's synthetic keys for clarity and better control.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit