Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ziadm
Specialist
Specialist

Left Join

I have the following script

FACT:

LOAD ReportedCustomerName,

     PostalCode,

     PartNumber,

     Quantity,

     Resale,

     ExtendedResale,

     CommissionPaid,

     CommissionPerct,

     Channel,

     ChannelIdentifier,

     CM,

     ShippedDate,

     PaidDate,

     Principal

FROM

(ooxml, embedded labels, table is Data);

Left Join

LOAD

     ShippedDate,

     '1' as Flag

FROM

(ooxml, embedded labels);

There are 6 files is Sales*.xlsx and 5 files is COMMT.*.xlsx

The load of sales file goes ok loadind sales files only when it joins on the 3 rd COMM file the script loading hangs any idea

Thanks

3 Replies
ToniKautto
Employee
Employee

The wildcard file name does not mean that all files are load in one load, it leads to multiple loads being executed. You should be able to confirm this behavior by looking in the document log.

The first load statement where FACT is created will likely not cause you  any practical issues. The Left Join load will however multiple the length of you table to a much higher number than you are expecting. To get around this you need to do the wildcard load into a temporary table, and then join the temporary table to the FACT table.

My guess is that the Shipped Dates should be distinct in the temporary table. This could be accomplishes by only loading dates that do not already exist in the temporary table.

TmpFlag:

LOAD

     ShippedDate,

     '1' as Flag

FROM

(ooxml, embedded labels)

Where Not Exists(ShippedDate);

Left Join ('FACT')

NoConcatenate LOAD *

Resident TmpFlag;

DROP Table TmpFlag;

ziadm
Specialist
Specialist
Author

Thanks Toni

ToniKautto
Employee
Employee

You're welcome!

If that resolved your issue I would suggest that you mark it as correct instead of helpful, or please let me know if it did resolve your issue.