Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating Flag

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

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

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;

View solution in original post

6 Replies
Anonymous
Not applicable
Author

you can load Table B with "where exists" clause and mark records with 'Yes',

and with "where not exists" - No

anbu1984
Master III
Master III

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;

Not applicable
Author

Hi Anbu...

Thanks for your help..It worked

Not applicable
Author

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

anbu1984
Master III
Master III

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 ];

Not applicable
Author

Got It... Thank You so much...