Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 tables,
Order_ID | Voucher | Owner |
---|---|---|
A | 1 | a |
B | 2 | a |
C | 3 | b |
Order_ID | Owner |
---|---|
D | b |
E | b |
F | b |
I want to concatenate two table like this,
Order_ID | Voucher | Owner |
---|---|---|
A | 1 | a |
B | 2 | a |
C | 3 | b |
D | 0 | b |
E | 0 | b |
F | 0 | b |
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.
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.
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;
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);
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:
I have enclosed a demo of it.