Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

EXISTS problem

Hi All,

I would like to only load records from  Table B only if they exists in Table A. I am pretty sure i want to be using Where Exists but I can not seem to get it correct

Thanks

Dan

TableA:

LOAD `Master Imaging Data ID`,

`Short Date of exam`,

SQL SELECT *

FROM `S:\Imaging - Data Repository\Imaging DR Summary Table.accdb`.`Tbl_ Imaging Data For Analysis`;

//Load Calendar

TableB

LOAD DateActual as [Short Date of exam],

SQL SELECT *

FROM `S:\Imaging - Data Repository\Look up tables\M_Calendar\Calendar LUT.accdb`.`M_Calendar`

WHERE EXISTS(DateActual, `Short Date of exam`);

2 Replies
nagaiank
Specialist III
Specialist III

If you have multiple rows in TableA with the same 'Short Date of exam', you may not get the result you want.

If there is only one row for each 'Short Date of exam' in TableA, you may use the script given below to load TableB

TempTable:

SQL SELECT *

FROM `S:\Imaging - Data Repository\Look up tables\M_Calendar\Calendar LUT.accdb`.`M_Calendar`;

TableB:

LOAD 'Short Date of exam' as DateActual Resident TableA;

Left Join (TableB) LOAD * Resident TempTable;


Not applicable
Author

table A has multiple values that are the same unfortunatley. thanks for your help tough.