Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 4 tables that I need the EMP Code to be linked when running a query in the script.
One Two Three Four
EMP EMP EMP EMP
DEPT LEAVEDATE HOURS NAME
In my script I have simple SQL Query for each table:
SELECT * FROM One
Where DEPT <> 'A' and DEPT <> 'B'
This returns the EMP with current DEPARTMENTS
--------------------------------------------------------
SQL SELECT *
FROM Two INNER JOIN
Four ON Two.EMP = Four.EMPREF
WHERE (Two.LEAVEDATE IS NULL);
This returns current department and current employees
-----------------------------------------------------------
SELECT * FROM Two
WHERE LEAVEDATE IS NULL;
---------------------------------------------------------
At the moment, I use a simple SQL * from Three, but hours for all employees including leavers and old departments are returned in charts.
Do you know how I could join this table to the other tables to follow the queries?
Thanks,
Gregg
If your first two queries are already returning all the employees you are interested in then you could use the EXISTS function in QlikView. Maybe your script could look like:
Data:
LOAD *; SQL SELECT <your query 1>;
JOIN (Data)
LOAD *; SQL SELECT <your query 2>;
JOIN (Data)
LOAD *
WHERE EXISTS (EMP)
; SQL SELECT * FROM Table3;
This way only employees that have already been loaded in the first 2 queries will be pulled by the third.
Hope this helps,
Jason
If your first two queries are already returning all the employees you are interested in then you could use the EXISTS function in QlikView. Maybe your script could look like:
Data:
LOAD *; SQL SELECT <your query 1>;
JOIN (Data)
LOAD *; SQL SELECT <your query 2>;
JOIN (Data)
LOAD *
WHERE EXISTS (EMP)
; SQL SELECT * FROM Table3;
This way only employees that have already been loaded in the first 2 queries will be pulled by the third.
Hope this helps,
Jason