Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeGaunt1
Contributor II
Contributor II

Cannot get a join to work correctly

Hi All, 

So I have two tables A & B. 

I first need to load Table A and retrieve ALL of field DTNUM according to the below criteria. 

Table A   
   
DTNUM Cannot equal 0 
PLWRK 

must equal '0600', '0602', '5440', '5442', '4980', '3930', '544E'

 

Now for all the retrieved rows I need to get data from Table B according to below criteria. Only Where the DTNUM field from Table A matches the DTNUM field in Table B 

Table B  
   
DTNUM  
PLUMI Cannot equal 'B'

 

There are far more fields I need to include but have slimmed down for simplicity 

[Table A]:
LOAD
    PLWRK,
    DTNUM
where not match (DTNUM,'0000000000');

[Table A]:
SELECT
PLWRK,
DTNUM,
FROM "X"
WHERE "PLWRK" IN ('0600', '0602', '5440', '5442', '4980', '3930', '544E')
;

Table B:

LIB CONNECT TO [X];

Left Join ([Table A])
LOAD
    DTNUM,
    PLUMI,
 WHERE NOT MATCH (PLUMI, 'B');

[Table B]:
SELECT 
DTNUM,
PLUMI,
FROM "X"
;

 

When I run the above it will cause no errors but the rows retrieved do not match the criteria. 

Any Assistance Is greatly received

 

TIA 

Labels (2)
1 Solution

Accepted Solutions
Clement15
Partner - Specialist
Partner - Specialist

Hello,

Have you tried inner join instead of left join?

View solution in original post

1 Reply
Clement15
Partner - Specialist
Partner - Specialist

Hello,

Have you tried inner join instead of left join?