Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
flygstolen_fred
Creator
Creator

Table field relation in load statement

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!

13 Replies
sunny_talwar

Where exactly are you using this Where clause in your script?

Anonymous
Not applicable

The where is evaluated before the field is renamed, so try using ContinentCode instead of BookingContinentCode

flygstolen_fred
Creator
Creator
Author

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.

flygstolen_fred
Creator
Creator
Author

Thanks for trying to help. Using ContinentCode instead didnt work either.

Anonymous
Not applicable

Could you post the whole load statement, otherwise it is hard to guess.

flygstolen_fred
Creator
Creator
Author

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.

flygstolen_fred
Creator
Creator
Author

Hi Sunny,

I have added the full load statement below. Thanks for trying to help.

Anonymous
Not applicable

Do you have the script where table TMPINVOICE is created ?

flygstolen_fred
Creator
Creator
Author

TMPINVOICE:

NOCONCATENATE

LOAD * RESIDENT Invoice;

INNER JOIN LOAD * RESIDENT Booking;

INNER JOIN

LOAD

    MarkupDesc,

    MarkupPrice,

    MarkupContinent,

    RESIDENT Markup;

Thanks!