Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Super quick question.
I can't test this now, because the files are in development. Here is my incremental load. Please see the bold.
Can I use Opportunity ID immediately like this? Or do I have to use ID?
NewOpportunity:
Load Product as Opp_Product,
ID as Opportunity_ID
from [new data];
// Add the new data to the old data
Concatenate(NewOpportunity)
LOAD
Product as Opp_Product,
ID as Opportunity_ID
FROM [old data]
where not exists(Opportunity_ID);
Yes that should work fine.
If you decide you want to though, you can also do this.
NewOpportunity:
Load Product as Opp_Product,
ID,
ID as OpportunityID
from [new data];
// Add the new data to the old data
Concatenate(NewOpportunity)
LOAD
Product as Opp_Product,
ID as Opportunity_ID
FROM [old data]
where not exists(ID);
Drop field ID;
The first table looks OK, for the second I would change the WHERE to
WHERE NOT EXISTS(Opportunity_ID, ID);
The second ID is the current table [old data] ID.
Interesting.
In the examples I saw for incremental load, there was only one parameter for the where not exists. Is this because I renamed my Primary Key?
Yes.
If you're 2nd load is from a QVD you'll want to make it where not Exists(ID) so that it stays an optimized load.
And then you can do
RENAME ID to Opportunity_ID
to get the field name what you want.
What if I just don't rename then?
I was going to rename since ID is a very general term, but if I dont rename it looks like this
Does this still work?
NewOpportunity:
Load Product as Opp_Product,
ID
from [new data];
// Add the new data to the old data
Concatenate(NewOpportunity)
LOAD
Product as Opp_Product,
ID as Opportunity_ID
FROM [old data]
where not exists(ID);
Yes that should work fine.
If you decide you want to though, you can also do this.
NewOpportunity:
Load Product as Opp_Product,
ID,
ID as OpportunityID
from [new data];
// Add the new data to the old data
Concatenate(NewOpportunity)
LOAD
Product as Opp_Product,
ID as Opportunity_ID
FROM [old data]
where not exists(ID);
Drop field ID;
Oh that works great, thanks!