Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to use a related field in the where clause of my load statement, but if fails.
LOAD
Booking AS BookingId,
Destination AS BookingDestination;
LOAD
IATA as BookingDestination,
ContinentCode as BookingContinentCode;
The following WHERE clause later in the load statement fails becuase "BookingContinentCode" is unkown:
WHERE BookingId = 2134 AND BookingContinentCode = 'EU';
Any help are appreciated!
Where exactly are you using this Where clause in your script?
The where is evaluated before the field is renamed, so try using ContinentCode instead of BookingContinentCode
Hi Sunny,
I'm concatenating my Booking table (first table in my post) with a third table, but I need to know the continentcode in the where clause.
Thanks for trying to help. Using ContinentCode instead didnt work either.
Could you post the whole load statement, otherwise it is hard to guess.
Hi,
Booking:
LOAD
Booking AS BookingId,
Destination AS BookingDestination,
Origin AS BookingOrigin;
Invoice:
LOAD Invoiceno AS InvoiceId,
Booking AS BookingId;
Product:
LOAD Invoiceno AS InvoiceId,
Description AS ProductDescription,
Price AS ProductPrice;
BookingDestinationGEO:
LOAD
IATA as BookingDestination,
ContinentName as BookingDestinationContinentName
FROM [lib://Statistics Export Folder/Iata.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
BookOriginGEO:
LOAD
BookingDestination as BookingOrigin,
BookingDestinationContinentCode as BookingOriginContinentCode
RESIDENT BookingDestinationGEO;
Markup:
LOAD
description AS MarkupDesc,
price AS MarkupPrice,
continent as MarkupContinent;
Concatenate (Product)
LOAD
InvoiceId,
MarkupDesc AS ProductDescription,
0 AS ProductPrice,
RESIDENT TMPINVOICE WHERE MarkupContinent LIKE '*' & BookingDestinationContinentName & '*');
Any suggestions are appreciated, thanks.
Hi Sunny,
I have added the full load statement below. Thanks for trying to help.
Do you have the script where table TMPINVOICE is created ?
TMPINVOICE:
NOCONCATENATE
LOAD * RESIDENT Invoice;
INNER JOIN LOAD * RESIDENT Booking;
INNER JOIN
LOAD
MarkupDesc,
MarkupPrice,
MarkupContinent,
RESIDENT Markup;
Thanks!