Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Please help me solve below issue.
I have to concatenate two tables.and i need the fields of that merged table qualified with the table name.
for example.
Qualify *;
Combined:
Load
F1,
F2
from ..../../..Table1.Qvd
Concatenate(Combined)
Load
F1,
F2
from ..../../.Table2.Qvd
UnQualify *:
Requirement is to get the field name like below:
Combined.F1
Combined.F2
But with above script i am getting the below
Combined.F1
Combined.F2
Table2.F1
Table2.F2 (these 2 fields are qualified with QVD/Excel table name)
Could someone please help?
Thanks&Regards
Jyothi
I suggest that you concatenate first and then use QUALIFY on a Resident table load
Temp:
Load
F1,
F2
from ..../../..Table1.Qvd
Concatenate(Temp)
Load
F1,
F2
from ..../../.Table2.Qvd
QUALIFY *;
Combined:
NoConcatenate
LOAD *
Resident Temp;
UNQUALIFY *;
DROP Table Temp;
Qualify *;
Combined:
Load
F1,
F2
from ..../../..Table1.Qvd;
UnQualify *;
Concatenate(Combined)
Load
F1 as Combined.F1,
F2 as Combined.F2
from ..../../.Table2.Qvd;
Hi Gysbert,
Thanks for the quick response.
I have near about 30 fields in the table.. so is this the only way to get it done?
Thanks,
Jyothi
No, the smart way is not to use QUALIFY at all.
Hi,
I would rather have an extra field in both table with each table source name and concatenate both table. So here is what am saying
Data:
LOAD
F1
,F2
'Data' AS %SourceTable
FROM ...//..///QVD(QVD);
Concatenate(Data)
LOAD
F1
,F2
'Data2' AS %SourceTable
FROM ...//...///qvd(qvd);
This way I think it's more quicker to load with qualifying each table first before concatenate.
I think qualifying each field will slow down you load.
I suggest that you concatenate first and then use QUALIFY on a Resident table load
Temp:
Load
F1,
F2
from ..../../..Table1.Qvd
Concatenate(Temp)
Load
F1,
F2
from ..../../.Table2.Qvd
QUALIFY *;
Combined:
NoConcatenate
LOAD *
Resident Temp;
UNQUALIFY *;
DROP Table Temp;
but thats the requirement sadly
i need to combine data from two tables and name the fields as Combined.Field_name.
First load both tables in the Combined table. Then create a new table with a qualified resident load from Combined. Finally drop the Combined table.
Best way according to me is to Concatenate first and then do Qualify as mentioned by sunindia
Yes this worked
Thanks Sunindia!