Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Concatenate two tables with their fields names qualified?

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

1 Solution

Accepted Solutions
sunny_talwar

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;

View solution in original post

9 Replies
Gysbert_Wassenaar

Qualify *;

Combined:

Load

F1,

F2

from ..../../..Table1.Qvd;


UnQualify *;

Concatenate(Combined)

Load

F1 as Combined.F1,

F2 as Combined.F2

from ..../../.Table2.Qvd;


talk is cheap, supply exceeds demand
Not applicable
Author

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

Gysbert_Wassenaar

No, the smart way is not to use QUALIFY at all.


talk is cheap, supply exceeds demand
Gabriel
Partner - Specialist III
Partner - Specialist III

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.

sunny_talwar

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;

Not applicable
Author

but thats the requirement sadly

i need to combine data from two tables and name the fields as Combined.Field_name.

Gysbert_Wassenaar

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.


talk is cheap, supply exceeds demand
Not applicable
Author

Best way according to me is to Concatenate first and then do Qualify as mentioned by sunindia

Not applicable
Author

Yes this worked

Thanks Sunindia!