Discussion Board for collaboration on QlikView Scripting.
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
Go to Solution.
In script you can concatenate your both table as both table have same column name.
concatenate(TableB) OR concatenate
you can also use left join between table
You can also rename your field but changing name for more column is not a standard way.So use concatenation .
Rename the fields! As shown below:
Load Campo1 as Campo_Novo
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.
If it 10 columns ,I will be able to rename the fields. What if there are 100 fields in table A and B. Each field will be joined with other table and renaming 100 fields is very difficult .This is just scenario , was asked in one interview question .
Can anyone comment on this
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.
You can use QUALIFY statement to remove Synthetic key
Load * Inline [A,B,C
Load * Inline [A,B,C,D
Let me know if this help ..............
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?
Hi , you can put also "QUALIFY * ;" before LOAD table name and it will rename all the fields like
' Table . Field '
and you will have
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 .
Qualify Field1 , Field2 ,.....
before the Load statement .
Please let me know if there is anything .