Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can any one please help me on below requirement.
I have Two Tables Table1 and Table 2 like below with the below data
Here need to compare Table 1 ID with Table 2 ID.If Table1 ID exists in Table 2 then Status is Yes else No.
Please help me to do in backend.
Thanks in advance
Table1:
Load
Emp_id,
.....
resident Table1
Table2:
Load
Emp_id,
'Yes' as status,
....
from table2 where exists (Emp_id,Emp_id)
concatenate
Load
Emp_id,
'No' as status,
....
from table2 where not exists (Emp_id,Emp_id)
As by francescoreggiani on other thread:
TableMap:
Mapping load
Employee ID ,
'Yes' as Status
from Table2;
Table1:
Load
ApplyMap('TableMap',[Employee ID],'No') as Status,
[Employee ID],
[Employee Name],
Startdate
EndDate
Company
From Table1;
Please create single thread only, this is a duplicate one & you can delete this
Look here
Table1:
Load
[Employee ID],
[Employee Name],
Startdate,
EndDate,
Company
From.....
Table2:
Load
[Employee ID],
[Employee Name],
Startdate
EndDate
From.....
map:
Mapping
Load
[Employee ID],
'Yes' as FieldName
Resident Table2
TableName:
Load
*,
ApplyMap('map', [Employee ID],'No') As Status
Resident Table1
Drop table Table1;
Table1:
LOAD * INLINE [
EmployeeID,Employee Name ,Startdate,EndDate,Company
15678,Rishi ,15/06/2017 ,18/06/2017 ,abc
78692 ,Rithika ,05/04/2018,18/04/2018 ,def
];
Table2:
LOAD * INLINE [
Employee_ID,Employee Name,Startdate ,EndDate ,Email,
15678 ,Rishi,15/06/2017,18/06/2017,Rishi@gmail.com
];
Tab3:
NoConcatenate
LOAD *,
if(Exists(Employee_ID,EmployeeID)=-1,'Yes','No') as Status
Resident Table1;
DROP Table Table1;