Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have two table :
Table1: Holds all employee details without 0 planning hours(<>0)
Table2: Hold all employees with zero planning hours.(=0)
Fileds name-Employee name,Project code,week,planning hours.
So there are chances that employees in table 1 may be in table 2 for some week.
Hence, I wont a table which holds data from table1 and table 2 but make sure
In case there are same employee in table1 and table2 , we should keep the one in table 1(<>0).
Kindly assist.
Thanks,
Prajna
Hi,
Can you send expected output?
by Sample Data
Table1:
Prajna,P1,W1,8
Prajna,P2,W1,3
Table2:
Prajna,P3,W1,0
Ramya,P1,w1,0
Output:
Prajna,P1,W1,8
Prajna,P2,W1,3
Ramya,P1,W1,0
Thanks,
Prajna
Like this:
LOAD [Employee name],[Project code],week,[planning hours]
FROM Table1;
Concatenate
LOAD [Employee name],[Project code],week,[planning hours]
FROM Table2
Where not(Exists([Employee name]);
Hi,
As Jonathan suggest you can use concatenate but if you have common entry in both table and you want only single entry of it then use join i.e. outer join
Regards,
Table:
LOAD [Employee name],[Project code],week,[planning hours]
FROM Table1;
Concatenate(T1)
LOAD [Employee name],[Project code],week,[planning hours]
FROM Table2 Where not(Exists([Employee name]);
Hi Prajna,
[Employee name] may not be enough in you case so if you need you can create key field and use it in Exists function:
LOAD Employee,
Project,
Week,
[Planning hours],
Employee&Project&Week as %Key
FROM Table1;
LOAD Employee,
Project,
Week,
[Planning hours],
Employee&Project&Week as %Key
FROM Table2
Where Not Exists (%Key,Employee&Project&Week);
BR,
Milosz
I added you script but where not exists doesnt seem to highlight
Hi,
try Milosz script it will work
In Jonathan script there are bracket missing if you correct it then it also work for you
Regards
Relove the parenthesis between not and Exists