Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying load complimentary data from multiple files keeping the records that exist on a previously loaded table:
Script
Transactions:
Load *;
select * from transactions;
Feedback:
LEFT KEEP (Transactions) LOAD transaction_id as trans_id,
disposition
FROM [lib://feedback files/*.txt]
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
Output
...
Feedback << pwmb_dispositions 06-24
Lines fetched: 238
Feedback-1 << pwmb_dispositions 06-26
Lines fetched: 133
Feedback-2 << pwmb_dispositions 06-27
Lines fetched: 116
Feedback-3 << pwmb_dispositions 06-28
Lines fetched: 145
Feedback-4 << pwmb_dispositions 06-29
Lines fetched: 30
...
$Syn 1 = trans_id+disposition
The problem is a synthetic key is generated. Some conclusions:
Is there any other way to achieve my goal?
Thanks
If you want to filter data use exits functions end of the table like based but transaction_id should exists in Transactions
Transactions:
Load *,;
select * from transactions;
Feedback:
LOAD transaction_id as trans_id,
disposition
FROM [lib://feedback files/*.txt]
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq) where exsits(transaction_id);
The Keep option prevents the files from automatically concatenating and you cannot force concatenation with the concatenate keyword. You can load the files using
Where Exists(transaction_id)
in the load statement.