Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
Hi!
Rename the fields! As shown below:
Table_Test:
Load Campo1 as Campo_Novo
By Rebeca
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
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
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.
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 ..............
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?
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
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 .