Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ritvik4BI
Partner - Contributor III
Partner - Contributor III

Field not found error in link table

Hi All,

I am using the below script to construct a link table between Sales and Returns and I am getting a field not found error. 

Returns:
LOAD ProductKey & '|' & TerritoryKey as key,
//ProductKey,
ReturnDate,
//TerritoryKey,
ProductKey,
ReturnQuantity
FROM
[C:\Users\lenovo\Desktop\QVDs\AdventureWorks_Returns.qvd]
(qvd);

 

TotalSales:
Load ProductKey & '|' & TerritoryKey as key,
OrderDate,
//StockDate,
OrderNumber,
//ProductKey,
CustomerKey,
//TerritoryKey,
OrderLineItem,
OrderQuantity
Resident Sales2015;
Drop Table Sales2015;

LinkTable:
LOAD Distinct
ProductKey & '|' & TerritoryKey as key,
ProductKey,
TerritoryKey
resident
TotalSales;

Concatenate
LOAD Distinct
ProductKey & '|' & TerritoryKey as key,
ProductKey,
TerritoryKey
resident
Returns;

Exit script;

The error I am getting is Field 'ProductKey' not found and Field 'TerritoryKey' not found.

What am I doing wrong here?

Regards.

 

2 Replies
Or
MVP
MVP

You're trying to load fields into the link table (in both loads) that have been commented out of the underlying resident table, so they don't exist in that table... that won't work.

If you need them, you'll have to load them in the original table. You can rename them and then drop field on the original if that's the data structure you're after.

MK9885
Master II
Master II

Enable generate log file in your app setting and see what table it gives you field not found.
And then check the original table if you have that field?