Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using renamed field name in following script

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);

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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;

View solution in original post

6 Replies
Miguel_Angel_Baeyens

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.

Not applicable
Author

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?

Anonymous
Not applicable
Author

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.

Not applicable
Author

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);

Anonymous
Not applicable
Author

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;

Not applicable
Author

Oh that works great, thanks!