1 Reply Latest reply: Apr 12, 2017 10:19 AM by omar bensalem RSS

    How to set up primary key in data load script

    Adam Hájek

      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

        • Re: How to set up primary key in data load script
          omar bensalem

          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,