Discussion Board for collaboration on QlikView Scripting.
I have a Patients table and Clinique Visits table.
Not all patients have visits records.
I’d like to add a flag to the Patients table
That represents when no visits exists for the relevant patients.
The following left join doesn’t work.
Left Join (Patients) LOAD PatientID, 'No' as WithClnVisits Resident [Clinique Visits] Where not Exists (PatientID);
Any idea why?
Go to Solution.
Try like this:
LOAD PatientID as PatientVisitID Resident [Clinique Visits];
if(exists(PatientVisitID, PatientID),'Yes','No') as WithClnVisits,
Drop table Visits;
You need to do an inner Join with the clinic visits first, and add a flag 'Yes'. Then concatenate the Resident PatientID table with Where not exists condition.
Thanks a lot!
Never saw this syntax before :-)
I managed to achieve the desied result with using the condition in a left join:
Left Join (Patients)
if(exists(QlnPatientID, PatientID),'Yes','No') as WithClnVisits