11 Replies Latest reply: Jun 26, 2014 4:40 PM by Mikael Kristensen RSS

    synthetic key

    sriram s

      Hi,

       

            I have two tables  A and B.Table A has 10 columns and table B has 10 columns .The columns names are same in both the tables. Because of the same column name synthetic key is getting formed.

       

      Can anyone tell me how to resolve the synthetic key that is being formed

       

      Thanks

      Sriram

        • Re: synthetic key

          Hi!

           

           

          Rename the fields! As shown below:

           

          Table_Test:

          Load Campo1 as Campo_Novo

           

          By Rebeca

          • Re: synthetic key
            Stefan Wühl

            Either concatenate your tables (I would have assumed auto-concatenation with two tables with same number of fields and field names anyway) --> CONCATENATE LOAD prefix

             

            Or rename the fields in one of the tables using AS. Only keep the field named the same that serve as key between the two. If you need more than 1 field as key, use a combined key.

            • Re: synthetic key
              Advait Thakur

              Hello Sri,

                You may try with an approach which swuehl has suggested.

               

              Make the aliases of fields or use Qualify/Unqualify statement. And if all fields are common then Qlikview will Auto-Concatenate.

              This will resolve your Synthetic Keys.

               

              Thanks

              Advait

              • Re: synthetic key
                Narender Makhija

                In script you can concatenate your both table as both table have same column name.

                 

                eg.

                 

                 

                TableA:

                ---------(your data);

                 

                concatenate(TableB)  OR concatenate

                 

                TableB:

                ---------(your data);

                 

                (alternate)

                you can also use left join between table

                 

                eg.

                TableA:

                ---------(your data);

                 

                left join(TableB)

                 

                TableB:

                ---------(your data);

                 

                 

                You can also rename your field but changing name for more column is not a standard way.So use concatenation .

                 

                Try it.

                • Re: synthetic key

                  Hi ,

                   

                  You can use QUALIFY statement to remove Synthetic key

                   

                  Eg:

                   

                  A:

                  Load * Inline [A,B,C

                  1,0,5

                  2,0,6

                  3,0,7];

                   

                   

                  QUALIFY A,B;

                  B:

                   

                  Load * Inline [A,B,C,D

                  4,0,1,9

                  5,0,2,10

                  6,0,3,11];

                   

                   

                  UNQUALIFY A,B;

                  Let me know if this help ..............

                  • Re: synthetic key
                    bobbyraj santhiogu

                    HI,

                    What is your aim? Do you want to have one table with the datas of the table A AND the table B or do you want to keep 2 different tables?

                    • Re: synthetic key
                      Ionut Cosconea

                      Hi , you can put also  "QUALIFY * ;" before LOAD table name and it will rename all the fields like

                      ' Table . Field '

                       

                      and you will have

                         

                      A.COL1

                      A.COL2

                      ..

                      A.COL10

                       

                      and

                       

                      B.COL1

                      B.COL2

                      ..

                      B.COL10

                      • Re: synthetic key
                        Yusuf Ali

                        HI Sriram ,

                                           The Best way is to Concatenate them . But if even though you want to have 2 Separate Tables then

                        You can use "Qualify" keyword .

                        like

                        Qualify Field1 , Field2 ,.....

                        before the Load statement .

                         

                        Please let  me know if there is anything .

                        • Re: synthetic key

                          Hi Sriram,

                          TABLE A    TABLEB

                          COL1          COL1

                          COL2          COL2

                          COL3          COL3

                          .....               ....

                          .....               ....

                          COL10        COL10    

                           

                          Before Load, give Qualify and Unqualify keywords

                          QUALIFY * ;

                          UNQUALIFY COL1 ;