Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
1adam_haj
Contributor III
Contributor III

How to set up primary key in data load script

Hi,

how can i set primary keys ( or synthetic keys ) in Data load editor ? .. Is it just by designation two columns ( from different tables ) with the same name ? or are there any other options ? I know that i can set up conections in data manager but, this is a situation with unlocked auto-generated section in data load editor so i can´t use data manager.

Thanks for answers

1 Solution

Accepted Solutions
OmarBenSalem

Qlik associates 2 tables by column names.

For example, you have in table1 a column named A and a table2 with a column also named A.

Qlik will associate your 2 tables with the column in common A and thus it will treat the column A as a 'primary key'

with that being said, Qlik can only make a direct association btwn 2 tables via 1 UNIQUE COLUMN; so in the case there is 2 or more fields in common btwn 2 tables; Qlik will create a synthetic table in which Qlik will put the fields in common as a synthetic key to associate the 2 tables.

And please note that Synthetic keys are bad since they're resource heavy and can even false the data.

You have to eliminate them and for that many solutions exist (link table, rename field etc)

Hope this helps,

Omar,

View solution in original post

1 Reply
OmarBenSalem

Qlik associates 2 tables by column names.

For example, you have in table1 a column named A and a table2 with a column also named A.

Qlik will associate your 2 tables with the column in common A and thus it will treat the column A as a 'primary key'

with that being said, Qlik can only make a direct association btwn 2 tables via 1 UNIQUE COLUMN; so in the case there is 2 or more fields in common btwn 2 tables; Qlik will create a synthetic table in which Qlik will put the fields in common as a synthetic key to associate the 2 tables.

And please note that Synthetic keys are bad since they're resource heavy and can even false the data.

You have to eliminate them and for that many solutions exist (link table, rename field etc)

Hope this helps,

Omar,