Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
adamjank
Contributor III
Contributor III

[Left Join / Less Rows] Issue

Hello,

I've experienced very, very strange situation as the SQL experienced employee.
So after Left Joining two tables, I've got less rows on the output...
For many reasons it can be more rows due to duplicates etc., but it shouldn't be less rows.

What are the possible reasons and the solutions for that critical issue?

The keys are generated via Autonumber() and it has the same seed, furthermore I haven't got the NULLs on these fields.

I'll try to prepare the file and the script.

27-3-2017 16:41:31: 0030  Binary [..\XXX.qvw]

27-3-2017 16:41:51: 0031  Let vNumberOfRows = NoOfRows('FINAL')

27-3-2017 16:41:51: 0032  Trace 4877810

27-3-2017 16:41:51: 0032  4877810

27-3-2017 16:41:51: 0033  Left  JOIN(FINAL)

27-3-2017 16:41:51: 0034  LOAD Distinct * RESIDENT D_XXX

27-3-2017 16:41:51:      11 fields found: %XXX.KEY, XXX.Name 4 516 lines fetched

27-3-2017 16:41:51:      Joining/Keeping

27-3-2017 16:42:08: 0035  Drop Table D_XXX

27-3-2017 16:42:09: 0036  Let vNumberOfRows = NoOfRows('FINAL')

27-3-2017 16:42:09: 0037  Trace 4219022

27-3-2017 16:42:09: 0037  4219022

Kind Regards,
Adam

Certified QS BA / DA Developer
Looking for the QS workaround for missing object properties
11 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Yes - it seems that it is an all or nothing thing.

Your sample script with the preceding load - DISTINCT is ignored:

Capture.PNG

And without the preceding load - DISTINCT propagates:

CaptureD.PNG

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Exactly.

I knew that your suggestion to use a RESIDENT table was the more reliable one. It still stands.

At least you got 10 virtual points from me