Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

concatenate two different table

Hi,

I have 2 tables,

Order_IDVoucherOwner
A1a
B2a
C3

b

Order_IDOwner
Db
Eb
Fb


I want to concatenate two table like this,


Order_IDVoucherOwner
A1a
B2a
C3b
D0b
E0b
F0b


How can I do that? One of the table is loaded from database and the other is from excel. I want to concatenate them at the front end.


Thanks,


Berker.

4 Replies
Not applicable
Author

Since one of the source don't have voucher and you can create the Vocher field while loading.

Please try Like below:

Let's voucher is in Missing in Excel file.

Data:

Select

     Order_Id,

     Voucher,

     Owner

From tablename;

Concatenate (Data)

Load

     Order_Id,

     0 as Voucher,

     Owner

From ExcelFiel

;

If Voucher is missing on the db table simple add dummy voucher value.

sunny_talwar

Alternatively you can do the check after you have concatenated also:

Data:

Select

     Order_Id,

     Voucher,

     Owner

From tablename;

Concatenate (Data)

Load

     Order_Id,

     Owner

From ExcelFiel

FinalData:

LOAD Order_Id,

          If(Len(Trim(Voucher)) = 0, 0, Voucher) as Voucher

          Owner

Resident Data;

DROP Table Data;

Anonymous
Not applicable
Author

I tried this one but I couldn't succeeded. I could get only excel or only qvd, the data after concatenate is not loaded to KARGO_BEDAVA.QVD

here is my code.

KARGO_BEDAVA:

LOAD

'$(vFIRMA)'&'|'&id as %KEY_CAMPAIGN_ID,

'b' as Sahip,

0 as Limit,

0 as kargo_karsilama;

SQL SELECT

id

FROM warehouse."public"."campaign_campaign";

Concatenate (KARGO_BEDAVA)

LOAD

  '$(vFIRMA)'&'|'&id  as %KEY_CAMPAIGN_ID,

  Sahip,

  Limit,

  kargo_karsilama;

LOAD [Kampanya ID] as id,

     Sahip,

     Limit,

     [Kargo Karsilama] as kargo_karsilama

FROM

[..\EXTERNAL\CRM Kurguları.xlsx]

(ooxml, embedded labels, table is Kargo);

petter
Partner - Champion III
Partner - Champion III

If you want a "concatenation" in the front end you don't need to do anything. Just load the two tables as is. It will create a Synthetic Key which good practice tells you that you should resolve - but for this purpose of illustrating the logic it is not necessary to do that:

2015-10-12 #2.PNG

I have enclosed a demo of it.