Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is my understanding of key/Perfect Key/Primary Key correct?

Hi All,

I am new to Qlikview and understand the following with respect to key/Perfect Key/Primary Key

1. Perfect Key: Mostly the Primary Key of Dimension Tables, i.e. Unique, Not Null keys and are used as surrogate key in fact tables to link to dimensions. viz. representative_key,Product_key,account_key etc. Since, Dimension key should exist in the table in order to link from fact its subset ratio is 100%. As per chinna's mail since subset ratio is 100% all value possible for the attribute must be there in the table.

2. Primary Key: In some cases null value is allowed for an attribute and thus any attribute of a table which is unique, null/not-null can be Primary Key. Normally the subset ratio is slightly less than 100% because of the null columns. So, we will have unique values and null values. Depending on how many nulls in total set will have subset value defined.

Since there is no foreign key constraint some new value for the attribute might be there in other table for the same column name and not in the parent table. As per Chinna's reply invoices and invoice line serves as example for INV03

3. Key on the other hand is from the fact tables which holds linkage to other tables and can have repeating values. i.e. multiple transaction for same account i.e. for a particular dimension key there can be multiple facts. Subset ratio is far less than 100%. Hence, if account_key is in transaction fact then we might have transaction for only 40% accounts. Rest accounts never had any transaction and so on.

Hope this helps. Please advise if my understanding is correct.

1 Solution

Accepted Solutions
2 Replies
swuehl
MVP
MVP

Maybe have a look at

Re: What makes a "Perfect Key"?

ysj
Creator
Creator