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

Trying to get rid of a Cartesian join

I have a 2 tables - One returns 24000 Transaction Lines and a second returns 1500 lines from a Financial Calendar QVD file.  When I left join the Calendar table to the transaction table I get 24000*1500 transactions. I have compared the underlying data I have perfect matches.  I have exported the table seperately to excel and performed a VLOOKUP function and get a match however when I perform a Left Join in QV I get a Cartesian join.  Any help is appreciated

TableScript
Sample Data Returned
Transaction

Trans:

Load

TPROD AS POLineItem,

TTDTE AS TransactionDate;

SELECT * FROM $(vSystem).$(vTable) WHERE (TTYPE = 'U');

POLineItemTransactionDate
3110.37420101108
3110.37420101122
3110.37420110110
3110.37420110127
3110.37420110203
3110.37420110217
3110.37420110311
3110.37420110314
3110.37420110405
3110.37420110520
Calendar

Calendar:

LEFT JOIN (Trans) LOAD

Date as TransactionDate,

FinanceYearPeriod;

SELECT * FROM c:\Qlikview\QVDs\Calendar.qvd;

TransactionDateFinanceYearPeriod
20090406201001
20090407201001
20090408201001
20090409201001
20090410201001
20090411201001
20090412201001
20090413201001
1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

I don't know if it helps, but I would skip the Calendar: prefix,

and get rid of the select * when reading from a qvd

like this:

Trans:

Load

TPROD AS POLineItem,

TTDTE AS TransactionDate;

SELECT * FROM $(vSystem).$(vTable) WHERE (TTYPE = 'U');

LEFT JOIN (Trans) LOAD

Date as TransactionDate,

FinanceYearPeriod

FROM c:\Qlikview\QVDs\Calendar.qvd;

View solution in original post

4 Replies
gandalfgray
Specialist II
Specialist II

I don't know if it helps, but I would skip the Calendar: prefix,

and get rid of the select * when reading from a qvd

like this:

Trans:

Load

TPROD AS POLineItem,

TTDTE AS TransactionDate;

SELECT * FROM $(vSystem).$(vTable) WHERE (TTYPE = 'U');

LEFT JOIN (Trans) LOAD

Date as TransactionDate,

FinanceYearPeriod

FROM c:\Qlikview\QVDs\Calendar.qvd;

MayilVahanan

Hi

Try like this

Trans:

Load

TPROD AS POLineItem,

TTDTE AS TransactionDate;

SELECT * FROM $(vSystem).$(vTable) WHERE (TTYPE = 'U');

LEFT JOIN (Trans) LOAD

Date as TransactionDate,

FinanceYearPeriod;

      FROM c:\Qlikview\QVDs\Calendar.qvd(qvd);

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Many thanks for your help.  It worked this way.

Paul

gandalfgray
Specialist II
Specialist II

Wouldn't it be better to credit the correct answer? 

Mayil's answer has a syntax error,

mine has not.

/h

Gandalf