Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everybody,
I have two tables with some fields.
Table A:
User Id,
EmplId,
FirstName,
LastName
Table B:
FullName,
PhoneNo,
EmployeeId,
CompanyName
Now I want to create two flag.
For ex, It will compare the EmplId field of Table A with the EmployeeId field of Table B and if the value of EmplId is available in EmployeeId field then it will display 'Yes' if it is not available then it will show 'No'.
Could anyone please tell me how to achieve this.
Thanks in Advance
Sonali.
T
Table_A:
Load User_Id,EmplId As EmployeeId,FirstName,LastName Inline [
User_Id,EmplId,FirstName,LastName
1,1,a,b
3,3,a,b
];
Join
Table_B:
Load * Inline [
FullName,PhoneNo,EmployeeId,CompanyName
aa,1,1,a
bb,2,2,c ];
NoConcatenate
Final:
Load EmployeeId,If(Not(IsNull(User_Id)) And Not(IsNull(CompanyName)),'Yes','No') As Flag Resident Table_A;
Drop table Table_A;
you can load Table B with "where exists" clause and mark records with 'Yes',
and with "where not exists" - No
Table_A:
Load User_Id,EmplId As EmployeeId,FirstName,LastName Inline [
User_Id,EmplId,FirstName,LastName
1,1,a,b
3,3,a,b
];
Join
Table_B:
Load * Inline [
FullName,PhoneNo,EmployeeId,CompanyName
aa,1,1,a
bb,2,2,c ];
NoConcatenate
Final:
Load EmployeeId,If(Not(IsNull(User_Id)) And Not(IsNull(CompanyName)),'Yes','No') As Flag Resident Table_A;
Drop table Table_A;
Hi Anbu...
Thanks for your help..It worked
Hi Anbu,
Just one doubt why you used the field user_Id and CompanyName in Flag?
Could you please explain me.. I am new to QlikView
Table is joined through employeeId. Now you can use any non-nullable fields(need not be user_Id and CompanyName) to identify whether employee is present in both the tables.
Just try this below and check the values in the resulting table
Table_A:
Load User_Id,EmplId As EmployeeId,FirstName,LastName Inline [
User_Id,EmplId,FirstName,LastName
1,1,a,b
3,3,a,b
];
Join
Table_B:
Load * Inline [
FullName,PhoneNo,EmployeeId,CompanyName
aa,1,1,a
bb,2,2,c ];
Got It... Thank You so much...