Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
The concatenation of a file A and a file B gives the following:
Customer_Code Customer_Name
123 Client_ABC
123 Client_EFG
I wish to keep the first one: (Client_ABC)
How to do ?
Thank you
So you only want to load records from File B that do not exist in File A ?
Try as below
Load
Customer_Code,
Customer_Name
From FileA;
concatenate
Load
Customer_Code,
Customer_Name
From FileB
WHERE NOT EXISTS(Customer_Code);
Thank you very much for your help, however you must have identical field names in both tables.
Can you confirm if my assumption is correct
So you only want to load records from File B that do not exist in File A ?
If not, then on what basis should we exclude a row.
Can you post your script?
// The 1st File
[Clients_S]:
LOAD
[Code Client] as Code_Client,
Client
FROM
(qvd);
Store Clients_S into
Drop table Clients_S;
// The 2nd File
Clients_Sellsy:
LOAD
[Code compte auxiliaire] as Code_Client,
[Client]
FROM
(txt, codepage is 1252, embedded labels, delimiter is ';', msq);
Store Clients_Sellsy into
Drop table Clients_Sellsy;
Clients:
Load *
From
(qvd);
Load *
From
(qvd)
WHERE NOT EXISTS ([Code_Client]);
Store Clients into
Not Necessarily
For your Script
// The 1st File
[Clients_S]:
LOAD
[Code Client] as Code_Client,
Client
FROM
// The 2nd File
Clients_Sellsy:
LOAD
[Code compte auxiliaire] as Code_Client,
[Client]
FROM
(
Where Not Exists (Code_Client, [Code compte auxiliaire]);
try below example
Load * inline [
Customer_Code,Customer_Name
123,ABC
546,XYZ
];
concatenate
Load CCode as Customer_Code,Customer_Name inline [
CCode,Customer_Name
123,XYZ
789,CVB
]
WHERE NOT EXISTS(Customer_Code,CCode);